[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 Alan Modra changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #15 from Alan Modra --- Fixed. -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 --- Comment #14 from cvs-commit at gcc dot gnu.org --- This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, master has been updated via cd0449ab05e9045682a81bf521bd0c8732c98feb (commit) from 1547d98f5a774617b38f2bdd9be3b5c21c2b9312 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cd0449ab05e9045682a81bf521bd0c8732c98feb commit cd0449ab05e9045682a81bf521bd0c8732c98feb Author: Alan Modra Date: Wed Apr 23 14:26:19 2014 +0930 PR ld/16787, stale dwarf2 stash Throw away the dwarf2 stash if it becomes invalid due to section VMAs changing. It would be nice to reclaim all the bfd_alloc memory here when we throw away the stash, perhaps by putting everything we alloc on a private dwarf2 objalloc, but I haven't done that with this patch. I've also fixed a problem with bfd_perform_relocation losing reloc addends, which meant a second or subsequent look at debug info sections did not properly relocate the sections. I can't see why bfd_perform_relocation should need to change addends except for ld -r, and the history (985fca12, e98e6ec1) doesn't help much. Finally, the patch tweaks place_sections to avoid unnecessary work. If we've mapped input to output sections, then input section VMA isn't used so there's not much point in adjusting it. Incidentally, this also means place_sections isn't effective in all cases. PR ld/16787 * dwarf2.c (struct dwarf2_debug): Add sec_vma field. (place_sections): Do not modify VMA of sections when called from linker after sections have been placed in output sections. Short circuit single section case. (save_section_vma, section_vma_same): New functions. (_bfd_dwarf2_slurp_debug_info): Throw away stash if section VMAs change. * reloc.c (bfd_perform_relocation): Do not modify reloc addend when non-relocatable. --- Summary of changes: bfd/ChangeLog | 13 + bfd/dwarf2.c | 85 - bfd/reloc.c |4 --- 3 files changed, 91 insertions(+), 11 deletions(-) -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 David Kredba changed: What|Removed |Added CC||nheghathivhistha at gmail dot com -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 Alan Modra changed: What|Removed |Added Assignee|unassigned at sourceware dot org |amodra at gmail dot com --- Comment #13 from Alan Modra --- Patch under test. This testcase tickles quite a few bugs. -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 --- Comment #12 from ma.jiang at zte dot com.cn --- (In reply to Nick Clifton from comment #10) > Sorry, but I still canont reproduce this failure. :-( > > H.J. - your test case does not demonstrated the problem, at least as far as > I can see. It shows the linker not referencing any source file when > complaining about the undefined reference: > > t13.o: In function `t3': > (.text+0x1a): undefined reference to `udf' > > Ma's bug report, if I understand it correctly, is about the linker > referencing the wrong source file (t4.c) in its output. Incidentally when I > run your test case on my system (x86_64 Fedora 20) I get the correct output: > > gcc -B./ -o x t13.o tt.o t2.o > t13.o: In function `t1': > /home/nickc/work/builds/gcc/current/x86_64-pc-linux-gnu/tests/t1.c:2: > warning: foobar > t13.o: In function `t3': > /home/nickc/work/builds/gcc/current/x86_64-pc-linux-gnu/tests/t3.c:2: > undefined reference to `udf' > > > Ma - your proposed patch might work - I have no way to test it at the moment > - but it does also have one flaw. It calls _bfd_dwarf2_cleanup_debug_info > without first checking to see if the input object file is an ELF format file. > > Ideally when we do have a fix for this problem we should add a test case to > the linker testsuite as well. Do you think that you could write one ? That > way, assuming that the test works for non-ARM based ELF targets I might be > able to reproduce the problem myself. > > Cheers > Nick Hi Nick, the testcase uploaded by H.J.Lu is a simpler version of mine.I use some macros to extend text seciont vma of t4.c, so that the wrong error shows the undefined referencing is in t4.c(In order to show how misleading the bug can be). H.J.Lu does not fake these macros, so the linker just can not find any file for the undefined referencing. Anyway ,the two tesecases are same in essence. I do not know why you can not reproduce the bug in your server.I have not use gold linker before.I think you could try H.J.Lu's advice. As to the fix, I think we could discuss it in detail after you reproduce the bug :-) -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 --- Comment #11 from H.J. Lu --- (In reply to Nick Clifton from comment #10) > Sorry, but I still canont reproduce this failure. :-( > > H.J. - your test case does not demonstrated the problem, at least as far as > I can see. It shows the linker not referencing any source file when > complaining about the undefined reference: > > t13.o: In function `t3': > (.text+0x1a): undefined reference to `udf' > > Ma's bug report, if I understand it correctly, is about the linker > referencing the wrong source file (t4.c) in its output. Incidentally when I It is the same issue with a different symptom. > run your test case on my system (x86_64 Fedora 20) I get the correct output: > > gcc -B./ -o x t13.o tt.o t2.o > t13.o: In function `t1': > /home/nickc/work/builds/gcc/current/x86_64-pc-linux-gnu/tests/t1.c:2: > warning: foobar > t13.o: In function `t3': > /home/nickc/work/builds/gcc/current/x86_64-pc-linux-gnu/tests/t3.c:2: > undefined reference to `udf' Your ld is gold. Try -fuse-ld=bfd. Gold works on this one, but fails the original test. > > Ma - your proposed patch might work - I have no way to test it at the moment > - but it does also have one flaw. It calls _bfd_dwarf2_cleanup_debug_info > without first checking to see if the input object file is an ELF format file. > > Ideally when we do have a fix for this problem we should add a test case to > the linker testsuite as well. Do you think that you could write one ? That > way, assuming that the test works for non-ARM based ELF targets I might be > able to reproduce the problem myself. That is what my testase is for. -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 Nick Clifton changed: What|Removed |Added Status|NEW |ASSIGNED --- Comment #10 from Nick Clifton --- Sorry, but I still canont reproduce this failure. :-( H.J. - your test case does not demonstrated the problem, at least as far as I can see. It shows the linker not referencing any source file when complaining about the undefined reference: t13.o: In function `t3': (.text+0x1a): undefined reference to `udf' Ma's bug report, if I understand it correctly, is about the linker referencing the wrong source file (t4.c) in its output. Incidentally when I run your test case on my system (x86_64 Fedora 20) I get the correct output: gcc -B./ -o x t13.o tt.o t2.o t13.o: In function `t1': /home/nickc/work/builds/gcc/current/x86_64-pc-linux-gnu/tests/t1.c:2: warning: foobar t13.o: In function `t3': /home/nickc/work/builds/gcc/current/x86_64-pc-linux-gnu/tests/t3.c:2: undefined reference to `udf' Ma - your proposed patch might work - I have no way to test it at the moment - but it does also have one flaw. It calls _bfd_dwarf2_cleanup_debug_info without first checking to see if the input object file is an ELF format file. Ideally when we do have a fix for this problem we should add a test case to the linker testsuite as well. Do you think that you could write one ? That way, assuming that the test works for non-ARM based ELF targets I might be able to reproduce the problem myself. Cheers Nick -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 --- Comment #9 from ma.jiang at zte dot com.cn --- Created attachment 7541 --> https://sourceware.org/bugzilla/attachment.cgi?id=7541&action=edit glibc libs -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 --- Comment #8 from ma.jiang at zte dot com.cn --- (In reply to Nick Clifton from comment #6) > Hi Ma, > Please could you upload the libc.a and libg.a files that you are > using. I have tried to find some on the net, but so far I have failed. :-( > Cheers > Nick Hi Nick, I have uploaded the two libs. You could also use the testcase uploaded by H.J. Lu, which does not need a special libc. Sorry to waste so much time on these trivial things. I thought glibc was easy to get... -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 H.J. Lu changed: What|Removed |Added CC||hjl.tools at gmail dot com -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 H.J. Lu changed: What|Removed |Added Status|WAITING |NEW -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 H.J. Lu changed: What|Removed |Added Attachment #7512|0 |1 is obsolete|| Attachment #7523|0 |1 is obsolete|| --- Comment #7 from H.J. Lu --- Created attachment 7540 --> https://sourceware.org/bugzilla/attachment.cgi?id=7540&action=edit A testcase [hjl@gnu-6 pr16787]$ make gcc -B./ -g -c -o t1.o t1.c gcc -B./ -g -c -o t3.o t3.c ld -r -o t13.o t1.o t3.o gcc -B./ -g -c -o tt.o tt.c gcc -B./ -g -c -o t2.o t2.c gcc -B./ -o x t13.o tt.o t2.o t13.o: In function `t1': /export/home/hjl/bugs/binutils/pr16787/t1.c:2: warning: foobar t13.o: In function `t3': (.text+0x1a): undefined reference to `udf' collect2: error: ld returned 1 exit status make: *** [x] Error 1 [hjl@gnu-6 pr16787]$ -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 --- Comment #6 from Nick Clifton --- Hi Ma, Please could you upload the libc.a and libg.a files that you are using. I have tried to find some on the net, but so far I have failed. :-( Cheers Nick -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 --- Comment #5 from ma.jiang at zte dot com.cn --- Hi Nick, I'm using the 2.24 release.I tried to get the current mainline sources, but I found it was too hart to get them(when working in windows and behind a stupid firewall)... The toolchain you used have no definitions for "getgrgid", that is the reason why you do not get the same error as me.Could you find a glibc toolchain? As my first mail said, the warning for "getgrgid" is critical. I can reproduce this bug on gcc4.5.2+binutils2.21+glibc2.13 and gcc4.8.2+binutils2.24+glibc2.18. -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 Nick Clifton changed: What|Removed |Added Status|NEW |WAITING --- Comment #4 from Nick Clifton --- Hi Ma, Thanks for the tt.c file. I think however that this might be a bug that has already been fixed. Using today's FSF gcc and binutils mainline sources I built your test case, but the linker gave the correct error messages: % arm-eabi-gcc tt.c t1234.o -o tt -static -g t1234.o: In function `t1': t1.c:2: undefined reference to `getgrgid' t1234.o: In function `t3': t3.c:2: undefined reference to `udf' Which version of the binutils are you using ? If it is the 2.24 release, then please could you try the current mainline sources and see if the problem persists. Cheers Nick -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 --- Comment #3 from ma.jiang at zte dot com.cn --- (In reply to Nick Clifton from comment #1) > Hi Ma, > > bug.sh tries to compile a file called tt.c which is missing from bin.zip. > Could you upload that file please ? > > Cheers > Nick Hi Nick, Thank you for your prompt reply. It's really nice to meet you, again. :-) I have uploaded the missing tt.c, sorry for the mistake.In fact, tt.c is just a main function which use a call to take t1234.o into the linking process. int main() { t2(); return 0; } -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 --- Comment #2 from ma.jiang at zte dot com.cn --- Created attachment 7523 --> https://sourceware.org/bugzilla/attachment.cgi?id=7523&action=edit missed file -- 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
[Bug ld/16787] LD gives wrong error messages
https://sourceware.org/bugzilla/show_bug.cgi?id=16787 Nick Clifton changed: What|Removed |Added CC||nickc at redhat dot com --- Comment #1 from Nick Clifton --- Hi Ma, bug.sh tries to compile a file called tt.c which is missing from bin.zip. Could you upload that file please ? Cheers Nick -- 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