<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 - DFSan wrapper function sometimes gets wrong 'dso_local' attribute"
href="https://bugs.llvm.org/show_bug.cgi?id=36314">36314</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>DFSan wrapper function sometimes gets wrong 'dso_local' attribute
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Miscellaneous Instrumentation passes
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>sbucur@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The "dfsw$" wrapper functions in DFSan are created using the
'GlobalValue::LinkOnceODRLinkage' linkage and inherit the attributes of the
original function by calling "NewF->copyAttributesFrom(F);".
However, when the original function (F) has internal linkage, it automatically
gets the 'dso_local' attribute via its GlobalValue constructor. This attribute
is thus inadvertently transferred to the wrapper (NewF), which has a public
linkage type and should not be marked 'dso_local'.
On x86_64, this behavior causes the wrapper symbol in the generated code to
have
a relocation table entry (R_X86_64_PC32) that triggers a linker error when
linking in a shared library.</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>