From f805cfba807819093db880d60634fcdd484cf9ae Mon Sep 17 00:00:00 2001 From: George Rimar Date: Wed, 14 Aug 2019 08:33:26 +0000 Subject: [PATCH] [llvm-objdump] - Add a relocation-xindex-symbol.test test case. This rewrites the exitent test case to use YAML instead of the precompiled object and moves it from test/Object to an appropriate llvm-objdump tests folder. Differential revision: https://reviews.llvm.org/D66140 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368811 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Object/Inputs/shndx.elf | Bin 824 -> 0 bytes test/Object/objdump-shndx.test | 8 ----- .../llvm-objdump/relocation-xindex-symbol.test | 36 +++++++++++++++++++++ 3 files changed, 36 insertions(+), 8 deletions(-) delete mode 100644 test/Object/Inputs/shndx.elf delete mode 100644 test/Object/objdump-shndx.test create mode 100644 test/tools/llvm-objdump/relocation-xindex-symbol.test diff --git a/test/Object/Inputs/shndx.elf b/test/Object/Inputs/shndx.elf deleted file mode 100644 index f1e0a3a8df7d797543936e91e2dd266dc4d827d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 824 zcwVb_^>JfjWMpQ50!9WqAjSkgkk}4Tk`qJa|NjhF05cYG6(APCp`Hzhnb5?z7#L7( z(<@5NNz^Mzttes8ODZmA&?~OYElEs@FV4tIsVHJdN-SbX%g+Z2mlOeoVbTnGDTyVC z43q;629Uon!44>GhbE35QfyE$HZ*YuD9wTopfzs?y Ingxvp08_dnX#fBK diff --git a/test/Object/objdump-shndx.test b/test/Object/objdump-shndx.test deleted file mode 100644 index f3691db9d60..00000000000 --- a/test/Object/objdump-shndx.test +++ /dev/null @@ -1,8 +0,0 @@ -RUN: llvm-objdump -r %p/Inputs/shndx.elf | FileCheck %s - -Test that llvm-objdump can handle shndx. The relocation points to a section -symbol that has st_shndx == SHN_XINDEX. To print the section name llvm-objdump -has to use the shndx section. - -CHECK: RELOCATION RECORDS FOR [.text]: -CHECK-NEXT: 0000000000000000 R_X86_64_32 bar diff --git a/test/tools/llvm-objdump/relocation-xindex-symbol.test b/test/tools/llvm-objdump/relocation-xindex-symbol.test new file mode 100644 index 00000000000..31cf9bc0e95 --- /dev/null +++ b/test/tools/llvm-objdump/relocation-xindex-symbol.test @@ -0,0 +1,36 @@ +## Test that llvm-objdump can handle SHN_XINDEX. The relocation points to a section +## symbol that has st_shndx == SHN_XINDEX. To print the section name llvm-objdump +## has to use the SHT_SYMTAB_SHNDX section. + +# RUN: yaml2obj %s -o %t +# RUN: llvm-objdump -r %t | FileCheck %s + +# CHECK: RELOCATION RECORDS FOR [.text]: +# CHECK-NEXT: 0000000000000000 R_X86_64_32 bar + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 +Sections: + - Name: .text + Type: SHT_PROGBITS + - Name: .rela.text + Type: SHT_RELA + Info: .text + Relocations: + - Offset: 0x0000000000000000 + Symbol: bar + Type: R_X86_64_32 + - Name: bar + Type: SHT_PROGBITS + - Name: .symtab_shndx + Type: SHT_SYMTAB_SHNDX + Link: .symtab + Entries: [ 0, 3 ] +Symbols: + - Name: bar + Type: STT_SECTION + Index: SHN_XINDEX -- 2.11.4.GIT