diff options
Diffstat (limited to 'llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs.test')
-rw-r--r-- | llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs.test | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs.test b/llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs.test index 04390eb4e30..8450b4e1f39 100644 --- a/llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs.test +++ b/llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs.test @@ -1,8 +1,8 @@ ## Show that --disassemble + --reloc prints relocations inline and does not dump ## the relocation sections. -# RUN: yaml2obj %s -o %t.o -# RUN: llvm-objdump %t.o -d -r | FileCheck %s --implicit-check-not="RELOCATION RECORDS" +# RUN: yaml2obj %s --docnum=1 -o %t1.o +# RUN: llvm-objdump %t1.o -d -r | FileCheck %s --implicit-check-not="RELOCATION RECORDS" # CHECK: 0: e8 00 00 00 00 callq 0 <.text+0x5> # CHECK-NEXT: 0000000000000001: R_X86_64_PC32 foo-4 @@ -40,3 +40,24 @@ Sections: Symbols: - Name: foo - Name: bar + +## Check we report an error if the relocated section identified by the +## sh_info field of a relocation section is invalid. + +# RUN: yaml2obj %s --docnum=2 -o %t2.o +# RUN: not llvm-objdump %t2.o --disassemble --reloc 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR + +# ERR: error: '[[FILE]]': section (1): failed to get a relocated section: invalid section index: 255 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 +Sections: +- Name: .rela.debug_info + Type: SHT_RELA + Link: 0 + Info: 0xFF + Relocations: [] |