1 # RUN: yaml2obj %s > %t
2 # RUN: llvm-objdump --all-headers -D -z %t | FileCheck %s --check-prefixes=COMMON,NOADJUST
3 # RUN: llvm-objdump --all-headers -D -z --adjust-vma=0x0 %t | FileCheck %s --check-prefixes=COMMON,NOADJUST
4 # RUN: llvm-objdump --all-headers -D -z --adjust-vma=0x123000 %t | FileCheck %s --check-prefixes=COMMON,ADJUST
7 # NOADJUST-NEXT: Idx Name Size VMA Type
8 # NOADJUST-NEXT: 0 00000000 0000000000000000
9 # NOADJUST-NEXT: 1 .text 00000002 0000000000000000 TEXT
10 # NOADJUST-NEXT: 2 .debug_str 00000004 0000000000000000
11 # NOADJUST-NEXT: 3 .rela.debug_str 00000018 0000000000000000
12 # NOADJUST-NEXT: 4 .data 00000004 0000000000000000 DATA
13 # NOADJUST-NEXT: 5 .rela.data 00000018 0000000000000000
14 # NOADJUST-NEXT: 6 .symtab 00000060 0000000000000000
15 # NOADJUST-NEXT: 7 .strtab 00000010 0000000000000000
16 # NOADJUST-NEXT: 8 .shstrtab 0000003c 0000000000000000
19 # ADJUST-NEXT: Idx Name Size VMA Type
20 # ADJUST-NEXT: 0 00000000 0000000000000000
21 # ADJUST-NEXT: 1 .text 00000002 0000000000123000 TEXT
22 # ADJUST-NEXT: 2 .debug_str 00000004 0000000000000000
23 # ADJUST-NEXT: 3 .rela.debug_str 00000018 0000000000000000
24 # ADJUST-NEXT: 4 .data 00000004 0000000000123000 DATA
25 # ADJUST-NEXT: 5 .rela.data 00000018 0000000000000000
26 # ADJUST-NEXT: 6 .symtab 00000060 0000000000000000
27 # ADJUST-NEXT: 7 .strtab 00000010 0000000000000000
28 # ADJUST-NEXT: 8 .shstrtab 0000003c 0000000000000000
30 # COMMON: SYMBOL TABLE:
31 # COMMON-NEXT: 0000000000000001 l F .text 00000000 func
32 # COMMON-NEXT: 0000000000000000 .text 00000000 sym
33 # COMMON-NEXT: 0000000000000000 l d .text 00000000 .text
35 # NOADJUST: 0000000000000000 sym:
36 # NOADJUST-NEXT: 0: {{.*}} nop
37 # NOADJUST: 0000000000000001 func:
38 # NOADJUST-NEXT: 1: {{.*}} retq
40 # ADJUST: 0000000000123000 sym:
41 # ADJUST-NEXT: 123000: {{.*}} nop
42 # ADJUST: 0000000000123001 func:
43 # ADJUST-NEXT: 123001: {{.*}} retq
45 # NOADJUST: 0000000000000000 .debug_str:
46 # NOADJUST-NEXT: 0: {{.*}} %al, (%rax)
47 # NOADJUST-NEXT: 0000000000000001: R_X86_64_32 .text
48 # NOADJUST-NEXT: 2: {{.*}} addb %al, (%rax)
50 # ADJUST: 0000000000000000 .debug_str:
51 # ADJUST-NEXT: 0: {{.*}} %al, (%rax)
52 # ADJUST-NEXT: 0000000000123001: R_X86_64_32 .text
53 # ADJUST-NEXT: 2: {{.*}} addb %al, (%rax)
55 # COMMON: 0000000000000000 .rela.debug_str:
56 # COMMON-NEXT: 0: {{.*}} addl %eax, (%rax)
57 ## ... There are more lines here. We do not care.
59 # NOADJUST: 0000000000000000 .data:
60 # NOADJUST-NEXT: 0: {{.*}} addb %al, (%rax)
61 # NOADJUST-NEXT: 0000000000000000: R_X86_64_32 .text
62 # NOADJUST-NEXT: 2: {{.*}} addb %al, (%rax)
64 # ADJUST: 0000000000123000 .data:
65 # ADJUST-NEXT: 123000: {{.*}} addb %al, (%rax)
66 # ADJUST-NEXT: 0000000000123000: R_X86_64_32 .text
67 # ADJUST-NEXT: 123002: {{.*}} addb %al, (%rax)
69 # COMMON: 0000000000000000 .rela.data:
70 # COMMON-NEXT: 0: {{.*}} addb %al, (%rax)
71 ## ... There are more lines here. We do not care.
82 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
83 AddressAlign: 0x0000000000000004
87 Flags: [ SHF_MERGE, SHF_STRINGS ]
88 AddressAlign: 0x0000000000000001
90 - Name: .rela.debug_str
93 AddressAlign: 0x0000000000000008
96 - Offset: 0x0000000000000001
101 Flags: [ SHF_WRITE, SHF_ALLOC ]
102 AddressAlign: 0x0000000000000001
107 AddressAlign: 0x0000000000000008
110 - Offset: 0x0000000000000000
117 Value: 0x0000000000000001