Article View: gnu.gcc.help
Article #53494Re: difference between "ld *.o" vs. "gcc *.o" ??
From: Marc Ullman
Date: Mon, 04 Nov 1991 08:09
Date: Mon, 04 Nov 1991 08:09
22 lines
1740 bytes
1740 bytes
>I built two sets of object files using CC(1) for one, and >gcc for the other. Now if I use the SUN-supplied ld to >link edit them like "ld cc*.o gcc*.o", my executable >is damaged (in my case, I received a Segmentation fault >error). > >But if I use either "cc cc*.o gcc*.o" or "gcc cc*.o gcc*.o", >the executable built will work. I certainly never ran into >this problem before when all my object files are all built >under one compiler. I wonder if you can shed some light >on my puzzle, and also to my question, i.e. are GCC and >sun's CC generate object files of the format ? The problem is that when ld is invoked via cc or gcc, a number of additional arguments are passed to it, such as crt0.o etc. Because SunOS now supports shared libraries and run-time dynamic linking, you do not see the result of having incorrectly linked your executable until run time. There is an option to ld called -assert that is supposed to allow you to detect this type of problem at link time; however, I have had limited success in using it. --Marc Ullman Stanford University
Technical Details
Message-ID:
<9111040809.AA08143@sun-valley.Stanford.EDU>Path:
arc1-ca.pugleaf.net!gmdzi!zeus.ieee.org!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sun-valley.stanford.edu!marcReferences:
<9110310317.AA09510@Texaco.COM>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,37fe2de5ee579981 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1991-11-04 04:20:30 PST Path: arc1-ca.pugleaf.net!gmdzi!zeus.ieee.org!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sun-valley.stanford.edu!marc From: marc@sun-valley.stanford.edu (Marc Ullman) Newsgroups: gnu.gcc.help Subject: Re: difference between "ld *.o" vs. "gcc *.o" ?? Message-ID: <9111040809.AA08143@sun-valley.Stanford.EDU> Date: 4 Nov 91 08:09:33 GMT References: <9110310317.AA09510@Texaco.COM> Sender: daemon@cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 22