Re: ld dynamic linker x86-64 ?!
- From: Waldek Hebisch <spamtrap@xxxxxxxxxx>
- Date: Thu, 23 Mar 2006 02:04:09 +0000 (UTC)
Claudio Daffra <spamtrap@xxxxxxxxxx> wrote:
hi all
hi have compiler a program in this way :
gcc x.c -S -o x.s
as x.s -o x.o
gcc x.o -o x
and work good but with ...
gcc x.c -S -o x.s
as x.s -o x.o
ld -e main -dynamic-linker /lib64/ld-linux-x86-64.so.2 -lc x.o -o x
the program terminate with seg. fault error ?
type
gcc -v x.o -o x. I get:
/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/3.4.4/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o x /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.4/crtbegin.o -L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.4 -L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.4/../../../../lib64 -L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.4/../../.. -L/lib/../lib64 -L/usr/lib/../lib64 x.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.4/crtend.o /usr/lib/../lib64/crtn.o
Note that the compiler links in crt1.o, crti.o, crtbegin.o, crtend.o, crtn.o
besides x.o (and order matters!). Compiled code depends on compiler-specific
runtime libraries (libgcc and libgcc_eh).
BTW: what are you trying to do? If you want to link compiled code then
the compiler know better what extra stuff should be linked in. If you
want to create standalone assembly program you can skip all of this.
--
Waldek Hebisch
hebisch@xxxxxxxxxxxxxxxx
.
- Follow-Ups:
- Re: ld dynamic linker x86-64 ?!
- From: Claudio Daffra
- Re: ld dynamic linker x86-64 ?!
- References:
- ld dynamic linker x86-64 ?!
- From: Claudio Daffra
- ld dynamic linker x86-64 ?!
- Prev by Date: Re: 2-dimensional DW array access without MULs?
- Next by Date: Re: Kernel Calling Conventions
- Previous by thread: ld dynamic linker x86-64 ?!
- Next by thread: Re: ld dynamic linker x86-64 ?!
- Index(es):
Relevant Pages
|