Re: problem on /proc/self/exe and /proc/num/exe
- From: Paul Pluzhnikov <ppluzhnikov-nsp@xxxxxxxxxxx>
- Date: Wed, 30 Aug 2006 21:19:11 -0700
"William" <snowingbear@xxxxxxxxx> writes:
But if I run test as a ld, compiled with
"gcc -Wl,--dynamic-linker test hello.c -o hello". It will fail on i386
and x86_64, but OK on ia64.
The problem is that your "test" ld is linked to load at the same
address as hello:
$ objdump -p ./hello | grep LOAD | head -1
LOAD off 0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12
$ objdump -p ./test | grep LOAD | head -1
LOAD off 0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12
You have to get your "test ld" out of the way by linking it at a
different address (using a linker script), or get your "hello"
executable out of the way by building it as a position-independent:
$ gcc -g junk.c -o test -static &&
gcc junk.c -Wl,--dynamic-linker=./test &&
./a.out
pid is 16060
string is /proc/16060/exe
readlink: No such file or directory
$ gcc -fPIC -pie junk.c -Wl,--dynamic-linker=./test &&
./a.out
pid is 16066
string is /proc/16066/exe
real file is /home/paul/a.out
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
.
- Follow-Ups:
- Re: problem on /proc/self/exe and /proc/num/exe
- From: William
- Re: problem on /proc/self/exe and /proc/num/exe
- References:
- problem on /proc/self/exe and /proc/num/exe
- From: William
- problem on /proc/self/exe and /proc/num/exe
- Prev by Date: Re: problem on /proc/self/exe and /proc/num/exe
- Next by Date: Re: X office crossover
- Previous by thread: Re: problem on /proc/self/exe and /proc/num/exe
- Next by thread: Re: problem on /proc/self/exe and /proc/num/exe
- Index(es):
Relevant Pages
|