OSDN Git Service

[llvm-readobj] Display section names for STT_SECTION symbols.
authorMatt Davis <Matthew.Davis@sony.com>
Fri, 1 Mar 2019 17:31:32 +0000 (17:31 +0000)
committerMatt Davis <Matthew.Davis@sony.com>
Fri, 1 Mar 2019 17:31:32 +0000 (17:31 +0000)
commit56d9da61e3c165e839f97bfeffb69d5bf85b361d
treed68f821fe20488e223c57ff1839be6cb5fb9c58a
parent994886702070c054eab681e85455f705a1015680
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355207 91177308-0d34-0410-b5e6-96231b3b80d8
test/MC/ARM/arm-elf-symver.s
test/MC/ELF/alias.s
test/MC/ELF/many-sections-2.s
test/MC/ELF/section-sym.s
test/MC/ELF/symver.s
test/MC/ELF/weakref.s
test/Object/readobj-shared-object.test
test/tools/llvm-readobj/gnu-symbols.test
test/tools/llvm-readobj/sections-ext.test
tools/llvm-readobj/ELFDumper.cpp