[llvm-bugs] [Bug 46488] New: [thinLTO] Unable to compile with IFUNC symbol
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Jun 29 01:15:23 PDT 2020
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: och95 at yandex.ru
Reporter: och95 at yandex.ru
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org
Assignee: och95 at yandex.ru
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200629/31e3cb3c/attachment-0001.html>
More information about the llvm-bugs
mailing list