This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
about gcc & ld
- To: <gcc at gcc dot gnu dot org>
- Subject: about gcc & ld
- From: Yu Tang <carino at mail dot ustc dot edu dot cn>
- Date: Tue, 9 Jan 2001 19:56:59 +0800 (CST)
Hi, I get my problem when I am study about ELF.
here is a simple c program:
---------------------------
/* haha.c */
#include "stdio.h"
int main()
{
printf("haha\n");
}//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
)
So what's wrong with my way? and how can i make gccld work proper?