This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]