[Bug lto/95928] LTO through ar breaks weak function resolution
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Jun 27 13:10:53 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95928
--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Andi Kleen from comment #8)
> It works fine without LTO.
>
> Otherwise the Linux kernel wouldn't work. It relies on this behavior for its
> syscalls.
>
[hjl@gnu-cfl-2 pr95928]$ make
/usr/gcc-9.3.1-x32/bin/gcc -B./ -c -o dummy.o dummy.c
/usr/gcc-9.3.1-x32/bin/gcc -B./ -c sys_ni.i
/usr/gcc-9.3.1-x32/bin/gcc -B./ -c capability.i
/usr/gcc-9.3.1-x32/bin/gcc-ar rc -o libx.a sys_ni.o capability.o
/usr/gcc-9.3.1-x32/bin/gcc -B./ -O2 -o x dummy.o libx.a
/usr/gcc-9.3.1-x32/bin/gcc -B./ -O2 -o y dummy.o sys_ni.o capability.o
objdump --disassemble=__x64_sys_capget x | grep sys_ni_syscall
401127: e8 e5 ff ff ff callq 401111 <sys_ni_syscall>
objdump --disassemble=__x64_sys_capget y | grep sys_ni_syscall
make: *** [Makefile:20: all] Error 1
[hjl@gnu-cfl-2 pr95928]$
> The test case is extracted from there.
Something is missing in this testcase.
More information about the Gcc-bugs
mailing list