1 # RUN: yaml2obj %s -o %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 {{.*}} 0000000000000000
15 # NOADJUST-NEXT: 7 .strtab {{.*}} 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 {{.*}} 0000000000000000
27 # ADJUST-NEXT: 7 .strtab {{.*}} 0000000000000000
28 # ADJUST-NEXT: 8 .shstrtab 0000003c 0000000000000000
30 # NOADJUST: SYMBOL TABLE:
31 # NOADJUST-NEXT: 0000000000000001 l F .text 0000000000000000 func
32 # NOADJUST-NEXT: 0000000000000000 l .text 0000000000000000 sym
33 # NOADJUST-NEXT: 0000000000000000 l d .text 0000000000000000 .text
34 # NOADJUST-NEXT: 0000000000003333 l *ABS* 0000000000000000 abs
35 # NOADJUST-NEXT: 0000000000000000 l .debug_str 0000000000000000 debug_str_sym
37 # ADJUST: SYMBOL TABLE:
38 # ADJUST-NEXT: 0000000000123001 l F .text 0000000000000000 func
39 # ADJUST-NEXT: 0000000000123000 l .text 0000000000000000 sym
40 # ADJUST-NEXT: 0000000000123000 l d .text 0000000000000000 .text
41 # ADJUST-NEXT: 0000000000003333 l *ABS* 0000000000000000 abs
42 # ADJUST-NEXT: 0000000000000000 l .debug_str 0000000000000000 debug_str_sym
44 # NOADJUST: 0000000000000000 <sym>:
45 # NOADJUST-NEXT: 0: {{.*}} nop
46 # NOADJUST: 0000000000000001 <func>:
47 # NOADJUST-NEXT: 1: {{.*}} retq
49 # ADJUST: 0000000000123000 <sym>:
50 # ADJUST-NEXT: 123000: {{.*}} nop
51 # ADJUST: 0000000000123001 <func>:
52 # ADJUST-NEXT: 123001: {{.*}} retq
54 # NOADJUST: 0000000000000000 <debug_str_sym>:
55 # NOADJUST-NEXT: 0: {{.*}} %al, (%rax)
56 # NOADJUST-NEXT: 0000000000000001: R_X86_64_32 .text
57 # NOADJUST-NEXT: 2: {{.*}} addb %al, (%rax)
59 # ADJUST: 0000000000000000 <debug_str_sym>:
60 # ADJUST-NEXT: 0: {{.*}} %al, (%rax)
61 # ADJUST-NEXT: 0000000000123001: R_X86_64_32 .text
62 # ADJUST-NEXT: 2: {{.*}} addb %al, (%rax)
64 # COMMON: 0000000000000000 <.rela.debug_str>:
65 # COMMON-NEXT: 0: {{.*}} addl %eax, (%rax)
66 ## ... There are more lines here. We do not care.
68 # NOADJUST: 0000000000000000 <.data>:
69 # NOADJUST-NEXT: 0: {{.*}} addb %al, (%rax)
70 # NOADJUST-NEXT: 0000000000000000: R_X86_64_32 .text
71 # NOADJUST-NEXT: 2: {{.*}} addb %al, (%rax)
73 # ADJUST: 0000000000123000 <.data>:
74 # ADJUST-NEXT: 123000: {{.*}} addb %al, (%rax)
75 # ADJUST-NEXT: 0000000000123000: R_X86_64_32 .text
76 # ADJUST-NEXT: 123002: {{.*}} addb %al, (%rax)
78 # COMMON: 0000000000000000 <.rela.data>:
79 # COMMON-NEXT: 0: {{.*}} addb %al, (%rax)
80 ## ... There are more lines here. We do not care.
91 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
92 AddressAlign: 0x0000000000000004
96 Flags: [ SHF_MERGE, SHF_STRINGS ]
97 AddressAlign: 0x0000000000000001
99 - Name: .rela.debug_str
102 AddressAlign: 0x0000000000000008
105 - Offset: 0x0000000000000001
110 Flags: [ SHF_WRITE, SHF_ALLOC ]
111 AddressAlign: 0x0000000000000001
116 AddressAlign: 0x0000000000000008
119 - Offset: 0x0000000000000000
126 Value: 0x0000000000000001
135 - Name: debug_str_sym