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


Thanks Jakub.

Yes you are right. I always try to avoid direct invoking of linker(ld).
But I am doing some R&D and hence I am doing this.
Actually I am using and passing my owned _start symbol for the linker.
So itried as follows:
$ gcc -nostdlib main.c -lc
Now its works fine for me.

Regards
Bhushan


-----Original Message-----
From: Jakub Jelinek [mailto:jakub@redhat.com]
Sent: Monday, June 30, 2008 6:28 PM
To: Bhushan Verma
Cc: binutils@sourceware.org
Subject: 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]