1 # RUN: yaml2obj --docnum=1 %s -o %t
2 # RUN: llvm-objdump --reloc %t > %t1
3 # RUN: llvm-objdump -r %t > %t2
5 # RUN: FileCheck %s --input-file=%t1 --strict-whitespace --match-full-lines
7 # CHECK:RELOCATION RECORDS FOR [.text]:
8 # CHECK-NEXT:OFFSET TYPE VALUE
9 # CHECK-NEXT:0000000000000001 R_X86_64_32 glob1
10 # CHECK-NEXT:0000000000000001 R_X86_64_32S glob2
11 # CHECK-NEXT:0000000000000002 R_X86_64_64 loc1
12 # CHECK-NEXT:0000000000000001 R_X86_64_32 glob1+0x1
13 # CHECK-NEXT:0000000000000001 R_X86_64_32S glob2+0x2
14 # CHECK-NEXT:0000000000000002 R_X86_64_64 loc1+0x3
17 FileHeader: !FileHeader
26 Content: "0000000000000000"
75 ## Check we report an error if the relocated section identified by the
76 ## sh_info field of a relocation section is invalid.
77 # RUN: yaml2obj --docnum=2 %s -o %t2
78 # RUN: not llvm-objdump --reloc %t2 2>&1 | FileCheck %s -DFILE=%t2 --check-prefix=ERR
79 # ERR: error: '[[FILE]]': section (1): unable to get a relocation target: invalid section index: 255
95 ## Check ranges of addends being displayed in a dump of relocations.
96 # RUN: yaml2obj --docnum=3 %s -o %t3
97 # RUN: llvm-objdump -r %t3 | FileCheck %s --check-prefix=ADDENDS
99 # ADDENDS: RELOCATION RECORDS FOR [.text]:
100 # ADDENDS: R_X86_64_64 glob-0x8000000000000000
101 # ADDENDS: R_X86_64_64 glob+0x7fffffffffffffff
102 # ADDENDS: R_X86_64_64 glob-0x1
103 # ADDENDS: R_X86_64_64 glob+0x12345678
104 # ADDENDS: R_X86_64_64 glob{{$}}
116 Flags: [SHF_EXECINSTR,SHF_ALLOC]
122 Addend: -9223372036854775808
128 Addend: 9223372036854775807
148 ## Check relocation formatting on 32 bit as well to verify the formatting is correct.
149 # RUN: yaml2obj --docnum=4 %s > %t4
150 # RUN: llvm-objdump -r %t4 | FileCheck %s --check-prefix=ELF32 --strict-whitespace --match-full-lines
152 # ELF32:RELOCATION RECORDS FOR [.text]:
153 # ELF32-NEXT:OFFSET TYPE VALUE
154 # ELF32-NEXT:00000001 R_386_32 global
155 # ELF32-NEXT:00000002 R_386_PC32 local
156 # ELF32-NEXT:00000001 R_386_NONE global+0x1
157 # ELF32-NEXT:00000002 R_386_NONE local+0x2