diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-03 05:14:22 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-03 05:14:22 +0000 |
commit | 201a551929fc6a3158e120602e0d5d570aee72c7 (patch) | |
tree | a5ba06605e0fa6c6ce5a8e11b5a5b1a67de956cb /test/Object | |
parent | 8c7a0fd91a1a0a64bba5545bc45c634f4315a2e3 (diff) |
Fix the interpretation of a 0 st_name.
The ELF spec is very clear:
-----------------------------------------------------------------------------
If the value is non-zero, it represents a string table index that gives the
symbol name. Otherwise, the symbol table entry has no name.
--------------------------------------------------------------------------
In particular, a st_name of 0 most certainly doesn't mean that the symbol has
the same name as the section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Object')
-rw-r--r-- | test/Object/obj2yaml.test | 47 | ||||
-rw-r--r-- | test/Object/readobj-shared-object.test | 20 |
2 files changed, 26 insertions, 41 deletions
diff --git a/test/Object/obj2yaml.test b/test/Object/obj2yaml.test index 2a3f7c841dd..08000f66581 100644 --- a/test/Object/obj2yaml.test +++ b/test/Object/obj2yaml.test @@ -267,26 +267,19 @@ ELF-MIPSEL-NEXT: - Name: '$.str' ELF-MIPSEL-NEXT: Type: STT_OBJECT ELF-MIPSEL-NEXT: Section: .rodata.str1.1 ELF-MIPSEL-NEXT: Size: 0x000000000000000D -ELF-MIPSEL-NEXT: - Name: .text -ELF-MIPSEL-NEXT: Type: STT_SECTION +ELF-MIPSEL-NEXT: - Type: STT_SECTION ELF-MIPSEL-NEXT: Section: .text -ELF-MIPSEL-NEXT: - Name: .data -ELF-MIPSEL-NEXT: Type: STT_SECTION +ELF-MIPSEL-NEXT: - Type: STT_SECTION ELF-MIPSEL-NEXT: Section: .data -ELF-MIPSEL-NEXT: - Name: .bss -ELF-MIPSEL-NEXT: Type: STT_SECTION +ELF-MIPSEL-NEXT: - Type: STT_SECTION ELF-MIPSEL-NEXT: Section: .bss -ELF-MIPSEL-NEXT: - Name: .mdebug.abi32 -ELF-MIPSEL-NEXT: Type: STT_SECTION +ELF-MIPSEL-NEXT: - Type: STT_SECTION ELF-MIPSEL-NEXT: Section: .mdebug.abi32 -ELF-MIPSEL-NEXT: - Name: .rodata.str1.1 -ELF-MIPSEL-NEXT: Type: STT_SECTION +ELF-MIPSEL-NEXT: - Type: STT_SECTION ELF-MIPSEL-NEXT: Section: .rodata.str1.1 -ELF-MIPSEL-NEXT: - Name: .reginfo -ELF-MIPSEL-NEXT: Type: STT_SECTION +ELF-MIPSEL-NEXT: - Type: STT_SECTION ELF-MIPSEL-NEXT: Section: .reginfo -ELF-MIPSEL-NEXT: - Name: .MIPS.abiflags -ELF-MIPSEL-NEXT: Type: STT_SECTION +ELF-MIPSEL-NEXT: - Type: STT_SECTION ELF-MIPSEL-NEXT: Section: .MIPS.abiflags ELF-MIPSEL-NEXT: Global: ELF-MIPSEL-NEXT: - Name: main @@ -343,22 +336,17 @@ ELF-MIPS64EL-NEXT: AddressAlign: 0x0000000000000004 ELF-MIPS64EL-NEXT: Content: '' ELF-MIPS64EL-NEXT: Symbols: ELF-MIPS64EL-NEXT: Local: -ELF-MIPS64EL-NEXT: - Name: .text -ELF-MIPS64EL-NEXT: Type: STT_SECTION +ELF-MIPS64EL-NEXT: - Type: STT_SECTION ELF-MIPS64EL-NEXT: Section: .text -ELF-MIPS64EL-NEXT: - Name: .data -ELF-MIPS64EL-NEXT: Type: STT_SECTION +ELF-MIPS64EL-NEXT: - Type: STT_SECTION ELF-MIPS64EL-NEXT: Section: .data -ELF-MIPS64EL-NEXT: - Name: .bss -ELF-MIPS64EL-NEXT: Type: STT_SECTION +ELF-MIPS64EL-NEXT: - Type: STT_SECTION ELF-MIPS64EL-NEXT: Section: .bss ELF-MIPS64EL-NEXT: - Name: bar ELF-MIPS64EL-NEXT: Section: .data -ELF-MIPS64EL-NEXT: - Name: .MIPS.options -ELF-MIPS64EL-NEXT: Type: STT_SECTION +ELF-MIPS64EL-NEXT: - Type: STT_SECTION ELF-MIPS64EL-NEXT: Section: .MIPS.options -ELF-MIPS64EL-NEXT: - Name: .pdr -ELF-MIPS64EL-NEXT: Type: STT_SECTION +ELF-MIPS64EL-NEXT: - Type: STT_SECTION ELF-MIPS64EL-NEXT: Section: .pdr ELF-MIPS64EL-NEXT: Global: ELF-MIPS64EL-NEXT: - Name: zed @@ -394,7 +382,7 @@ ELF-X86-64-NEXT: AddressAlign: 0x0000000000000008 ELF-X86-64-NEXT: Info: .text ELF-X86-64-NEXT: Relocations: ELF-X86-64-NEXT: - Offset: 0x000000000000000D -ELF-X86-64-NEXT: Symbol: .rodata.str1.1 +ELF-X86-64-NEXT: Symbol: '' ELF-X86-64-NEXT: Type: R_X86_64_32S ELF-X86-64-NEXT: - Offset: 0x0000000000000012 ELF-X86-64-NEXT: Symbol: puts @@ -408,14 +396,11 @@ ELF-X86-64-NEXT: Symbols: ELF-X86-64-NEXT: Local: ELF-X86-64-NEXT: - Name: trivial-object-test.s ELF-X86-64-NEXT: Type: STT_FILE -ELF-X86-64-NEXT: - Name: .text -ELF-X86-64-NEXT: Type: STT_SECTION +ELF-X86-64-NEXT: - Type: STT_SECTION ELF-X86-64-NEXT: Section: .text -ELF-X86-64-NEXT: - Name: .rodata.str1.1 -ELF-X86-64-NEXT: Type: STT_SECTION +ELF-X86-64-NEXT: - Type: STT_SECTION ELF-X86-64-NEXT: Section: .rodata.str1.1 -ELF-X86-64-NEXT: - Name: .note.GNU-stack -ELF-X86-64-NEXT: Type: STT_SECTION +ELF-X86-64-NEXT: - Type: STT_SECTION ELF-X86-64-NEXT: Section: .note.GNU-stack ELF-X86-64-NEXT: Global: ELF-X86-64-NEXT: - Name: main diff --git a/test/Object/readobj-shared-object.test b/test/Object/readobj-shared-object.test index 516d4c699e4..508caca9717 100644 --- a/test/Object/readobj-shared-object.test +++ b/test/Object/readobj-shared-object.test @@ -128,61 +128,61 @@ ELF: ] ELF: Symbols [ ELF: Symbol { -ELF: Name: .hash +ELF: Name: (0) ELF: Binding: Local ELF: Type: Section ELF: Section: .hash ELF: } ELF: Symbol { -ELF: Name: .dynsym +ELF: Name: (0) ELF: Binding: Local ELF: Type: Section ELF: Section: .dynsym ELF: } ELF: Symbol { -ELF: Name: .dynstr +ELF: Name: (0) ELF: Binding: Local ELF: Type: Section ELF: Section: .dynstr ELF: } ELF: Symbol { -ELF: Name: .text +ELF: Name: (0) ELF: Binding: Local ELF: Type: Section ELF: Section: .text ELF: } ELF: Symbol { -ELF: Name: .eh_frame +ELF: Name: (0) ELF: Binding: Local ELF: Type: Section ELF: Section: .eh_frame ELF: } ELF: Symbol { -ELF: Name: .tdata +ELF: Name: (0) ELF: Binding: Local ELF: Type: Section ELF: Section: .tdata ELF: } ELF: Symbol { -ELF: Name: .dynamic +ELF: Name: (0) ELF: Binding: Local ELF: Type: Section ELF: Section: .dynamic ELF: } ELF: Symbol { -ELF: Name: .got.plt +ELF: Name: (0) ELF: Binding: Local ELF: Type: Section ELF: Section: .got.plt ELF: } ELF: Symbol { -ELF: Name: .data +ELF: Name: (0) ELF: Binding: Local ELF: Type: Section ELF: Section: .data ELF: } ELF: Symbol { -ELF: Name: .bss +ELF: Name: (0) ELF: Binding: Local ELF: Type: Section ELF: Section: .bss |