https://sourceware.org/bugzilla/show_bug.cgi?id=16756
Bug ID: 16756 Summary: Incorrect warning message Product: binutils Version: 2.25 (HEAD) Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: hjl.tools at gmail dot com This testcase is derived from PR 12760 since we only see the warning section after the LTO IR symbols have been loaded. Since we don't keep the undefined reference when seeing a definition, we lose the reference info: [hjl@gnu-6 warn-6]$ cat foo.c void foo () { } [hjl@gnu-6 warn-6]$ cat bar.c static const char _evoke_link_warning_foo[] __attribute__ ((used, section (".gnu.warning.foo"))) = "function foo is deprecated"; [hjl@gnu-6 warn-6]$ cat main.c extern void foo (); int main () { foo (); return 0; } [hjl@gnu-6 warn-6]$ make gcc -B./ -O2 -g -c -o main.o main.c gcc -B./ -O2 -g -c -o foo.o foo.c gcc -B./ -O2 -g -c -o bar.o bar.c gcc -B./ -nostdlib -Wl,-e,main -o x main.o foo.o bar.o foo.o: warning: function foo is deprecated ^^^ It should be main.c, not foo.o. [hjl@gnu-6 warn-6]$ gcc -B./ -nostdlib -Wl,-e,main -o x main.o bar.o foo.o main.o: In function `main': /export/home/hjl/bugs/binutils/warn-6/main.c:5: warning: function foo is deprecated [hjl@gnu-6 warn-6]$ -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils