[llvm-bugs] [Bug 40368] New: ifunc turns into alias when using LTO

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 17 13:09:45 PST 2019


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

            Bug ID: 40368
           Summary: ifunc turns into alias when using LTO
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Linker
          Assignee: unassignedbugs at nondot.org
          Reporter: sjc at immunant.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 21349
  --> https://bugs.llvm.org/attachment.cgi?id=21349&action=edit
Minimal ifunc test case that does not build with -flto

Functions declared with the "ifunc" attribute are correctly handled without
LTO, but as soon as LTO is enabled (full or thin), the bitcode linking drops
the ifunc and treats it as an alias. This leads to completely incorrect code
generation for the ifunc.

ifunc.o (compiled with -flto -c):

    @foo = dso_local ifunc i8* (i8*, i32, i64), bitcast (i8* (i8*, i32, i64)*
()* @foo_resolver to i8* (i8*, i32, i64)*)

a.out.0.0.preopt.bc (linked with -flto -Wl,--plugin-opt,save-temps):

    @foo = dso_local alias i8* (i8*, i32, i64), bitcast (i8* (i8*, i32, i64)*
()* @foo_resolver to i8* (i8*, i32, i64)*)

-- 
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/20190117/7ba794d4/attachment-0001.html>


More information about the llvm-bugs mailing list