/usr/lib/libc.so.1 as an interpreter

Jakub Jelinek jakub@redhat.com
Mon Jun 30 11:16:00 GMT 2008


On Mon, Jun 30, 2008 at 05:59:19PM +0900, Bhushan Verma wrote:
> $ gcc -c main.c
> $ ld -o main main.o -lc

Don't invoke ld directly, ever, unless you have very strong reason to
do so and know all the details how to invoke the linker.
Just use
gcc -o main main.o
and the gcc driver will take care of passing all the needed options
to the linker.  You can run
gcc -v -o main main.o
to see what options are passed to the linker, but note that those options
keep changing (usually new options are being added) and just relying
on gcc knowing the details saves you from adjusting your makefile every
time some change in ld invocation is needed.

	Jakub



More information about the Binutils mailing list