This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Weird LD problems
- From: "John Anthony Kazos Jr." <jkazos at vt dot edu>
- To: binutils at sources dot redhat dot com
- Date: Sun, 25 May 2003 20:38:21 -0400
- Subject: Weird LD problems
I have tried combo after combo of commands, and I just can't seem to figure
this out. can anyone please help? I just made a simple C program that did
nothing but exit(3), and I'm trying to link it manually using ld.
I copied /lib/ld-linux.so.2 to my current dir as ld-test.so, and I copied
/lib/libc.so.6 to my current dir as libc-test.so. I used "gcc -c" to make a
main.o from my main.c. (When I did a normal "gcc main.c -o test" and
"./test; echo $?" it worked fine.) But I just can't get it to work, giving
me strange file-not-found and _start not found and other things.
What I am trying to do is separate linking from loading. I want to say "go
look at /a/b/c/something.so, and there's your symbols to link against. Now,
when you get run, I want you to use 'somethingelse.so' as your loader and
'funstuff.so' as that library, and let the system figure out where they
are." How can I do this? I am trying to eliminate all instances of
hard-coded directories in my executables, so that a package dir can be
anywhere (and can be moved anywhere) and work.