<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Use section name for section symbol names in llvm-readobj"
href="https://bugs.llvm.org/show_bug.cgi?id=40788">40788</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Use section name for section symbol names in llvm-readobj
</td>
</tr>
<tr>
<th>Product</th>
<td>tools
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>llvm-readobj
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jh7370.2008@my.bristol.ac.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>jh7370.2008@my.bristol.ac.uk, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>llvm-readobj + llvm-readelf print an empty string for section symbols. This is
technically correct, in the section symbols typically have no name, but it is
not particularly useful and makes the symbol table dump harder to interpret
(you have to lookup the section index and inspect the section header table to
map the symbol to its corresponding section).
This is similar to <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - llvm-nm should print section names for section symbols"
href="show_bug.cgi?id=39995">bug 39995</a>, where section names are now being used for symbol
names for ELF STT_SECTION symbols. However, whereas that bug brought llvm-nm
closer to GNU nm's output, the same is not the case here. It is worth noting
that GNU objdump's -t output also uses the section names for such symbols.
I think we should do the same here. In all likelihood it won't hurt any
parsers, since the name is at the end of the line, and would be an improvement
over GNU readelf. I think we should do it for both GNU and LLVM style output as
GNU style is more compact and more familiar to many developers.
Current output:
C:\llvm\llvm\test\tools\llvm-readobj> c:\llvm\build\debug\bin\llvm-readobj.exe
"--symbols" "C:\llvm\llvm\test\tools\llvm-readobj/Inputs/relocs.obj.elf-x86_64"
"--elf-output-style=GNU"
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
Proposal:
C:\llvm\llvm\test\tools\llvm-readobj> c:\llvm\build\debug\bin\llvm-readobj.exe
"--symbols" "C:\llvm\llvm\test\tools\llvm-readobj/Inputs/relocs.obj.elf-x86_64"
"--elf-output-style=GNU"
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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>