This is the mail archive of the
mailing list for the GCC project.
Re: about gcc & ld
- To: "Yu Tang" <carino at mail dot ustc dot edu dot cn>,<gcc at gcc dot gnu dot org>
- Subject: Re: about gcc & ld
- From: "Yu Xuanwei" <yxw at chinacluster dot com>
- Date: Wed, 10 Jan 2001 09:56:12 +0800
- References: <Pine.GSO.4.31L2A.0101091944410.25540-100000@mail>
----- Original Message -----
From: Yu Tang <email@example.com>
Sent: Tuesday, January 09, 2001 7:56 PM
Subject: about gcc & ld
> Hi, I get my problem when I am study about ELF.
> here is a simple c program:
> /* haha.c */
> #include "stdio.h"
> int main()
> I compiled it as following steps
> #gcc -c haha.c
> #ld haha.o /usr/lib/crt0.o /usr/lib/crti.o /usr/XXX/crtbegin.o
> /usr/XXX/crtend.o -lc -o hahald
> And It can't work. :( [but when use #gcc haha.c -o hahagcc]
> and hahagcc works.
> (I have found a little difference between hahagcc & hahald,
> the section .intrp of hahagcc is "/usr/lib/ld-linux.so.2",
> while hahald is "/usr/lib/libc.so.1
Just utilize GCC. The GCC specs file defines which ld is involved during
compiling. ld-linux.so.2 is a integral component of glibc as a linker. But
ld doesn' know which glibc is suitable to current GCC. So that's why we
could get more than one GCC in one Linux platform.
> So what's wrong with my way? and how can i make gccld work proper?