question about using gcc and ld

Alan Modra amodra@bigpond.net.au
Mon Feb 23 09:41:00 GMT 2009


On Mon, Feb 23, 2009 at 04:52:11PM +0800, Min-Hua Chen wrote:
> I don't understand why this happened. gcc calls ld to link object
> file, but why can't I
> generate the same result by using gcc and ld separately?

You can, but you need to invoke ld the same way gcc does.  gcc adds a
lot of other object files, libraries and options to the ld command
line.  Add -v to your gcc link to get a hint.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list