bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting core dump with GNU ld version 2.13.90 20021111 with -nostdlib op


From: Krishna Murthy
Subject: getting core dump with GNU ld version 2.13.90 20021111 with -nostdlib option.
Date: Tue, 23 Sep 2003 07:19:35 -0700 (PDT)

I am using GNU ld version 2.13.90 20021111 with gcc compiler gcc (GCC) 3.3.
 
I am getting
 
"collect2: ld terminated with signal 11 [Segmentation fault], core dumped"
 
When I run gcc with -nostdlib option and giving -lc before the source file.
 
example   $ gcc -nostdlib -lc /tmp/GCC/test.c
(Liniking to libc.so)
 
I have gone through the "ld" code, and found that
-------------------------------------------------------------------------------------------------------------------
-> ld while parsing the arguments, when it finds the dynamic object first, like "libc.so",
in the global "link_info" structure the "dynobj" member is assined with
the the bfd pointer of the above dynamic object (libc.so in our case) as a template.  .  Immediately after few steps,  abfd->sections made null.         
The effect is the "dynobj->sections" also became null in the global "link_info."
 
 -> Later, the "contents' member of the different dynamic sections (.plt, .reloc, ...) of the above "dynobj" are initialized, looping through the sections of the above "dynobj".  Since the sections member is already assinged to NULL, this is not happening in this case.
 
-> At the final link it is trying to access the "contents" members of those sections and dumping core.
 
-> But if I give   $ gcc -nostdlib  /tmp/GCC/test.c -lc , it is not dumping core and exiting with error code 1.
-> The reason is, since "test.o" (taken as a template for dynamic sections)  is not a dynamic object,  "dynobj->sections" of "link_info" is not assigned with NULL.  So everything is fine.
-------------------------------------------------------------------------------------------------------------------
 
Can some body help me out,  Whether the problem is with the "ld version" I am using or the platfrom on which I am using the ld.
 
Thanks & Regards,
-Krishna.


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
reply via email to

[Prev in Thread] Current Thread [Next in Thread]