https://sourceware.org/bugzilla/show_bug.cgi?id=31644
--- Comment #12 from H.J. Lu <hjl.tools at gmail dot com> --- Created attachment 15469 --> https://sourceware.org/bugzilla/attachment.cgi?id=15469&action=edit A testcase [hjl@gnu-cfl-3 31644]$ make gcc -B./ -g -flto -c -o x.o x.c gcc -B./ -g -c -o foo.o foo.c ar -rv libfoo.a foo.o ar: creating libfoo.a a - foo.o gcc -B./ -g -fPIC -c -o bar.o bar.c gcc -B./ -shared -o libbar.so bar.o gcc -B./ -o x x.o libfoo.a libbar.so -Wl,-R,. ./ld: libfoo.a(foo.o): in function `foo': /export/home/hjl/bugs/binutils/31644/foo.c:6:(.text+0x5): undefined reference to `bar' collect2: error: ld returned 1 exit status make: *** [Makefile:15: x] Error 1 rm foo.o [hjl@gnu-cfl-3 31644]$ gcc -c x.c [hjl@gnu-cfl-3 31644]$ make gcc -B./ -o x x.o libfoo.a libbar.so -Wl,-R,. ./x [hjl@gnu-cfl-3 31644]$ -- You are receiving this mail because: You are on the CC list for the bug.