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: unassignedb...@nondot.org
          Reporter: s...@immunant.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to