diff options
| author | Matt Davis <Matthew.Davis@sony.com> | 2019-03-01 17:31:32 +0000 |
|---|---|---|
| committer | Matt Davis <Matthew.Davis@sony.com> | 2019-03-01 17:31:32 +0000 |
| commit | 8a6f11f45fad375f2b42d865c841cb163fdf5686 (patch) | |
| tree | 4797b8aedecb46be3452c2e6683d1747e2263a76 /llvm/test/MC | |
| parent | 12b1f2418d6fea2a59861aa5e6cc243047ce614b (diff) | |
| download | bcm5719-llvm-8a6f11f45fad375f2b42d865c841cb163fdf5686.tar.gz bcm5719-llvm-8a6f11f45fad375f2b42d865c841cb163fdf5686.zip | |
[llvm-readobj] Display section names for STT_SECTION symbols.
Summary:
This patch will obtain the section name for symbols that refer to a section. Prior to this patch the Name field for STT_SECTIONs was blank, now it is populated.
Before:
```
Symbol table '.symtab' contains 6 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1
2: 0000000000000000 0 SECTION LOCAL DEFAULT 3
3: 0000000000000000 0 SECTION LOCAL DEFAULT 4
4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_
5: 0000000000000000 0 TLS GLOBAL DEFAULT UND sym
```
With this patch:
```
Symbol table '.symtab' contains 6 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 .text
2: 0000000000000000 0 SECTION LOCAL DEFAULT 3 .data
3: 0000000000000000 0 SECTION LOCAL DEFAULT 4 .bss
4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_
5: 0000000000000000 0 TLS GLOBAL DEFAULT UND sym
```
This fixes PR40788
Reviewers: jhenderson, rupprecht, espindola
Reviewed By: rupprecht
Subscribers: emaste, javed.absar, arichardson, MaskRay, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58796
llvm-svn: 355207
Diffstat (limited to 'llvm/test/MC')
| -rw-r--r-- | llvm/test/MC/ARM/arm-elf-symver.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/ELF/alias.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/ELF/many-sections-2.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/ELF/section-sym.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/ELF/symver.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/ELF/weakref.s | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/llvm/test/MC/ARM/arm-elf-symver.s b/llvm/test/MC/ARM/arm-elf-symver.s index ce9c4fe5f00..8a0aefc68f6 100644 --- a/llvm/test/MC/ARM/arm-elf-symver.s +++ b/llvm/test/MC/ARM/arm-elf-symver.s @@ -78,7 +78,7 @@ global1: @ CHECK-NEXT: Section: .text @ CHECK-NEXT: } @ CHECK-NEXT: Symbol { -@ CHECK-NEXT: Name: (0) +@ CHECK-NEXT: Name: .text (0) @ CHECK-NEXT: Value: 0x0 @ CHECK-NEXT: Size: 0 @ CHECK-NEXT: Binding: Local (0x0) diff --git a/llvm/test/MC/ELF/alias.s b/llvm/test/MC/ELF/alias.s index df39fd4be14..c575ce81b41 100644 --- a/llvm/test/MC/ELF/alias.s +++ b/llvm/test/MC/ELF/alias.s @@ -107,7 +107,7 @@ leaq .Llocal1(%rip), %rdi // CHECK-NEXT: Section: .text // CHECK-NEXT: } // CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: (0) +// CHECK-NEXT: Name: .data (0) // CHECK-NOT: Symbol { // CHECK: } // CHECK-NEXT: Symbol { diff --git a/llvm/test/MC/ELF/many-sections-2.s b/llvm/test/MC/ELF/many-sections-2.s index 2c3e4b87bb8..71ac870c8bc 100644 --- a/llvm/test/MC/ELF/many-sections-2.s +++ b/llvm/test/MC/ELF/many-sections-2.s @@ -32,7 +32,7 @@ // Test that this file has one section too many. -// SYMBOLS: Name: (0) +// SYMBOLS: Name: dm (0) // SYMBOLS: Value: 0x0 // SYMBOLS: Size: 0 // SYMBOLS: Binding: Local (0x0) diff --git a/llvm/test/MC/ELF/section-sym.s b/llvm/test/MC/ELF/section-sym.s index 9e660526b7a..5d5486f9f7a 100644 --- a/llvm/test/MC/ELF/section-sym.s +++ b/llvm/test/MC/ELF/section-sym.s @@ -82,7 +82,7 @@ // CHECK-NEXT: Section: .group // CHECK-NEXT: } // CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: (0) +// CHECK-NEXT: Name: foo (0) // CHECK-NEXT: Value: 0x0 // CHECK-NEXT: Size: 0 // CHECK-NEXT: Binding: Local (0x0) diff --git a/llvm/test/MC/ELF/symver.s b/llvm/test/MC/ELF/symver.s index 0f434dd859d..8883d192d28 100644 --- a/llvm/test/MC/ELF/symver.s +++ b/llvm/test/MC/ELF/symver.s @@ -77,7 +77,7 @@ global1: // CHECK-NEXT: Section: .text // CHECK-NEXT: } // CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: (0) +// CHECK-NEXT: Name: .text (0) // CHECK-NEXT: Value: 0x0 // CHECK-NEXT: Size: 0 // CHECK-NEXT: Binding: Local diff --git a/llvm/test/MC/ELF/weakref.s b/llvm/test/MC/ELF/weakref.s index d342c61f745..986e92d1d47 100644 --- a/llvm/test/MC/ELF/weakref.s +++ b/llvm/test/MC/ELF/weakref.s @@ -116,7 +116,7 @@ bar15: // CHECK-NEXT: Section: .text // CHECK-NEXT: } // CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: (0) +// CHECK-NEXT: Name: .text (0) // CHECK-NEXT: Value: 0x0 // CHECK-NEXT: Size: 0 // CHECK-NEXT: Binding: Local |

