https://bugs.llvm.org/show_bug.cgi?id=46488
Bug ID: 46488
Summary: [thinLTO] Unable to compile with IFUNC symbol
Product: new-bugs
Version: trunk
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Assignee: [email protected]
The code example:
$ cat thinlto-ifunc.c
typedef int (*func)(void);
int called(void)
{
return 1;
}
func resolver(void)
{
return called;
}
__attribute__ ((ifunc ("resolver"))) int foo(void);
int main(int argc, char *argv[])
{
foo();
}
$ clang -O3 -flto=thin thinlto-ifunc.c -o out
/usr/bin/ld: /tmp/lto-llvm-1798eb.o: in function `main':
thinlto-ifunc.c:(.text.main+0x2): undefined reference to `resolver'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And in case if ifunc call is in another C file:
$ clang -O3 -flto=thin thinlto-ifunc.c ex.c -o out
/tmp/lto-llvm-d8c1fd.o: in function `main':
ex.c:(.text.main+0x2): undefined reference to `foo'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs