This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: /usr/lib/libc.so.1 as an interpreter
- From: "Bhushan Verma" <bhushan dot verma at iap-online dot com>
- To: "Jakub Jelinek" <jakub at redhat dot com>
- Cc: <binutils at sourceware dot org>
- Date: Tue, 1 Jul 2008 09:49:58 +0900
- Subject: 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