diff options
Diffstat (limited to 'llvm/test/tools/llvm-objdump/relocations-elf.test')
-rw-r--r-- | llvm/test/tools/llvm-objdump/relocations-elf.test | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/llvm/test/tools/llvm-objdump/relocations-elf.test b/llvm/test/tools/llvm-objdump/relocations-elf.test index 751dfbb5807..becbc35d81a 100644 --- a/llvm/test/tools/llvm-objdump/relocations-elf.test +++ b/llvm/test/tools/llvm-objdump/relocations-elf.test @@ -8,9 +8,9 @@ # CHECK-NEXT: 0000000000000001 R_X86_64_32 glob1 # CHECK-NEXT: 0000000000000001 R_X86_64_32S glob2 # CHECK-NEXT: 0000000000000002 R_X86_64_64 loc1 -# CHECK-NEXT: 0000000000000001 R_X86_64_32 glob1+1 -# CHECK-NEXT: 0000000000000001 R_X86_64_32S glob2+2 -# CHECK-NEXT: 0000000000000002 R_X86_64_64 loc1+3 +# CHECK-NEXT: 0000000000000001 R_X86_64_32 glob1+0x1 +# CHECK-NEXT: 0000000000000001 R_X86_64_32S glob2+0x2 +# CHECK-NEXT: 0000000000000002 R_X86_64_64 loc1+0x3 --- !ELF FileHeader: !FileHeader @@ -90,3 +90,56 @@ Sections: Relocations: - Offset: 0x1 Type: R_X86_64_NONE + +## Check ranges of addends being displayed in a dump of relocations. +# RUN: yaml2obj --docnum=3 %s > %t3 +# RUN: llvm-objdump -r %t3 | FileCheck %s --check-prefix=ADDENDS + +# ADDENDS: RELOCATION RECORDS FOR [.text]: +# ADDENDS: R_X86_64_64 glob-0x8000000000000000 +# ADDENDS: R_X86_64_64 glob+0x7fffffffffffffff +# ADDENDS: R_X86_64_64 glob-0x1 +# ADDENDS: R_X86_64_64 glob+0x12345678 +# ADDENDS: R_X86_64_64 glob{{$}} + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 +Sections: +- Name: .text + Type: SHT_PROGBITS + Size: 8 + Flags: [SHF_EXECINSTR,SHF_ALLOC] +- Name: .rela.text + Type: SHT_RELA + Info: .text + Relocations: + - Offset: 0x0 + Addend: -9223372036854775808 + Symbol: glob + Type: R_X86_64_64 + - Offset: 0x1 + Symbol: glob + Type: R_X86_64_64 + Addend: 9223372036854775807 + - Offset: 0x2 + Symbol: glob + Type: R_X86_64_64 + Addend: -1 + - Offset: 0x3 + Symbol: glob + Type: R_X86_64_64 + Addend: 0x12345678 + - Offset: 0x4 + Symbol: glob + Type: R_X86_64_64 + Addend: 0 +Symbols: + - Name: glob + Section: .text + Value: 0x0 + Size: 0 + Binding: STB_GLOBAL |