<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 - x86: Redundant dynamic relocation against function"
href="https://bugs.llvm.org/show_bug.cgi?id=32938">32938</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>x86: Redundant dynamic relocation against function
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>ELF
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hjl.tools@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>[hjl@gnu-6 lld-2]$ cat x.c
extern void foo (void);
void *
foo_p ()
{
foo ();
return foo;
}
[hjl@gnu-6 lld-2]$ make
./clang -fpic -c -o x.o x.c
./ld.lld --shared -o x.so x.o
[hjl@gnu-6 lld-2]$ readelf -r x.so
Relocation section '.rela.dyn' at offset 0x240 contains 1 entries:
Offset Info Type Sym. Value Sym. Name +
Addend
0000000030d0 000100000006 R_X86_64_GLOB_DAT 0000000000000000 foo + 0
Relocation section '.rela.plt' at offset 0x258 contains 1 entries:
Offset Info Type Sym. Value Sym. Name +
Addend
000000002018 000100000007 R_X86_64_JUMP_SLO 0000000000000000 foo + 0
[hjl@gnu-6 lld-2]$ ld --shared -o x.so x.o
[hjl@gnu-6 lld-2]$ readelf -r x.so
Relocation section '.rela.dyn' at offset 0x240 contains 1 entries:
Offset Info Type Sym. Value Sym. Name +
Addend
000000200ff8 000300000006 R_X86_64_GLOB_DAT 0000000000000000 foo + 0
[hjl@gnu-6 lld-2]$</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>