Problems executing /lib/ld-linux.so.2
I have been trying to compile a new glibc many, many times,
wasting a lot of time :), and it always failed in a point where the
dynamic linker (ld-linux.so.2) was executed with one program as the
argument. IMHO, that is one of the best things the new libc has, but
it never worked for me in sparc. Example:
[i386] $ /lib/ld-linux.so.2 /bin/ls -al
drwxr-xr-x 2 root root 1024 Nov 17 11:43 .
drwxr-xr-x 8 root root 1024 Nov 17 11:43 ..
[sparc] $ /lib/ld-linux.so.2 /bin/ls -al
Well, it sometimes hangs, but sometimes dies with SIGSEGV,
sometimes with SIGBUS, sometimes with SIGILL...
Stracing it, this is the last syscall:
[000123b4] mmap(0x10000, 24576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x10000
Can you see what happens? I didn't see it until two weeks
trying to know what happened.
Hint: it is mmap'ing something, _overwriting_ the code that
is being executed!
It happens because the text addr in elf32_sparc starts at
offset 0x10000, overwriting part of the loader. In i386 systems, it
starts at 0x08048000, so there isn't any problem here.
The default text start offset is defined in file
ld/emulparams/elf32_sparc.sh, in the binutils source. Does anyone
know if it can be changed? If not, maybe we'll have to change the
text address of ld-linux.so.2 in glibc.
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to email@example.com .