<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 - llvm-objdump doesn't handle symbols referring the .plt section, or print symbols within it."
href="https://bugs.llvm.org/show_bug.cgi?id=38186">38186</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>llvm-objdump doesn't handle symbols referring the .plt section, or print symbols within it.
</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>Linux
</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-objdump
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>saugustine@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Without the symbols listed in the .plt section, it is hard to know exactly what
symbol is being called. In this example, the only thing that appears is an
offset at the call site, and no symbols at all inside the .plt section. Compare
this to gnu objdump.
$ cat t.s
.section .text,"ax",@progbits
.global foo
foo:
call foo@plt
$ ./bin/clang t.s -fpic -c
$ ./bin/ld.lld t.o -shared
$ ./bin/llvm-objdump -d a.out
a.out: file format ELF64-x86-64
Disassembly of section .text:
foo:
1000: e8 1b 00 00 00 callq 27
Disassembly of section .plt:
.plt:
1010: ff 35 f2 0f 00 00 pushq 4082(%rip)
1016: ff 25 f4 0f 00 00 jmpq *4084(%rip)
101c: 0f 1f 40 00 nopl (%rax)
1020: ff 25 f2 0f 00 00 jmpq *4082(%rip)
1026: 68 00 00 00 00 pushq $0
102b: e9 e0 ff ff ff jmp -32 <.plt>
Compare that to gnu's objdump:
$ objdump -d a.out
a.out: file format elf64-x86-64
Disassembly of section .text:
0000000000001000 <foo>:
1000: e8 1b 00 00 00 callq 1020 <foo@plt>
Disassembly of section .plt:
0000000000001010 <foo@plt-0x10>:
1010: ff 35 f2 0f 00 00 pushq 0xff2(%rip) # 2008
<foo@plt+0xfe8>
1016: ff 25 f4 0f 00 00 jmpq *0xff4(%rip) # 2010
<foo@plt+0xff0>
101c: 0f 1f 40 00 nopl 0x0(%rax)
0000000000001020 <foo@plt>:
1020: ff 25 f2 0f 00 00 jmpq *0xff2(%rip) # 2018
<foo@plt+0xff8>
1026: 68 00 00 00 00 pushq $0x0
102b: e9 e0 ff ff ff jmpq 1010 <foo+0x10></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>