https://sourceware.org/bugzilla/show_bug.cgi?id=32860
Bug ID: 32860 Summary: Definition in the archive is ignored with LTO Product: binutils Version: 2.45 (HEAD) Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: hjl.tools at gmail dot com Target Milestone: --- [hjl@gnu-tgl-3 lto-6]$ cat pr31482a.c #include <stdlib.h> int main() { abort (); return 0; } [hjl@gnu-tgl-3 lto-6]$ cat pr31482c.c #include <stdlib.h> #include <stdio.h> void abort (void) { printf ("PASS1\n"); exit (0); } [hjl@gnu-tgl-3 lto-6]$ make gcc -B./ -O2 -flto -fno-fat-lto-objects -c -o pr31482a.o pr31482a.c gcc -B./ -O2 -flto -fno-fat-lto-objects -c -o pr31482c.o pr31482c.c ar -rv libstatic.a pr31482c.o ar: creating libstatic.a a - pr31482c.o gcc -B./ -O2 -flto -fno-fat-lto-objects -Wl,--as-needed -o x pr31482a.o libstatic.a ./x make: *** [Makefile:11: all] Aborted (core dumped) rm pr31482c.o [hjl@gnu-tgl-3 lto-6]$ There is no reference to abort in pr31482a.o IR since abort is a builtin function. But the second LTO scan doesn't pick up abort in libstatic.a. -- You are receiving this mail because: You are on the CC list for the bug.