[llvm-bugs] [Bug 36314] New: DFSan wrapper function sometimes gets wrong 'dso_local' attribute

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 8 23:45:41 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36314

            Bug ID: 36314
           Summary: DFSan wrapper function sometimes gets wrong
                    'dso_local' attribute
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Miscellaneous Instrumentation passes
          Assignee: unassignedbugs at nondot.org
          Reporter: sbucur at google.com
                CC: llvm-bugs at lists.llvm.org

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180209/19dd96ce/attachment-0001.html>


More information about the llvm-bugs mailing list