With -g -O2 option, crx-elf-gcc generates wrong line numbers and function names. == /tmp/ccrrZsJf.o: In function `090312 (experimental)': /home10/swami/test.c:5: undefined reference to `_f1' collect2: ld returned 1 exit status === Expected output could be: === /tmp/ccEJcFRs.o: In function `main': /home10/swami/test.c:6: undefined reference to `_f1' collect2: ld returned 1 exit status ---- testcase: "test.c" ==== int f = 1; extern int f1 (); main () { f1(); } ===
This is a binutils issue. The error is reported with the location of the calling function, not the call.
Subject: Re: wrong function name and line numbers with -g -O2 option rguenth at gcc dot gnu dot org wrote: > > ------- Comment #1 from rguenth at gcc dot gnu dot org 2009-03-23 13:47 ------- > This is a binutils issue. The error is reported with the location of the > calling function, not the call. Yes, this issue need to fixed in gcc and binutils also. I am working on this issue and will send the patch soon. Thanks Swami
*** Bug 39535 has been marked as a duplicate of this bug. ***