[llvm-bugs] [Bug 48096] New: Non-constructor function pointers in .ctors are dropped

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 6 00:42:05 PST 2020


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

            Bug ID: 48096
           Summary: Non-constructor function pointers in .ctors are
                    dropped
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: dlj at google.com
                CC: llvm-bugs at lists.llvm.org, maskray at google.com,
                    smithp352 at googlemail.com

LLD seems to drop function pointers in the `.ctors` section that are not C++
constructors.

Example:

https://compiler-explorer.com/z/9dcG7c

There's a lot going on here with priority ordering, but the upshot that BFD LD
preserves function pointers (which are not C++ constructors) explicitly placed
into `.ctors` or `.ctors.*` with both GCC and Clang, but Clang+LLD drops them.

(The same happens with C, where there are no actual C++ constructors:
https://compiler-explorer.com/z/Yrsbbx)

-- 
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/20201106/8aa5c52f/attachment.html>


More information about the llvm-bugs mailing list