[llvm-bugs] [Bug 31932] New: PIC references to __dso_handle should behave as with hidden visibility

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 10 12:16:25 PST 2017


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

            Bug ID: 31932
           Summary: PIC references to __dso_handle should behave as with
                    hidden visibility
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: roland at hack.frob.com
                CC: llvm-bugs at lists.llvm.org, phosek at chromium.org
    Classification: Unclassified

When Clang emits calls to __cxa_atexit, it generates references to the symbol
__dso_handle.  The sole purpose of this symbol is that it have a different
address in each linked module (shared library or the executable).  To that end,
its definition is always made with hidden visibility.  So using the GOT
indirection table in PIC mode just adds extra indirection overhead and an extra
dynamic reloc that will always be relaxed into a simple R_*_RELATIVE.

GCC emits references to __dso_handle that do not use the GOT.

I have a patch to fix this, though it might need some cleanup.

-- 
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/20170210/45250e93/attachment.html>


More information about the llvm-bugs mailing list