still happening with 2.13 ( GIT checkout of @2011-04-04, 'git checkout -f glibc-2.13' ) , for any shared object for 32-bit sub-arch on x86_64, that is linked with '-nostdlib' :
1. 32-bit fails: $ echo 'int r = 42;' > rc.c $ gcc -m32 -shared -fPIC -o rc.so rc.c $ /lib32/ld-2.13.so --list ./rc.so linux-gate.so.1 => (0xf7757000) libc.so.6 => /lib32/libc.so.6 (0xf75d6000) /lib32/ld-2.13.so (0xf7758000) $ gcc -m32 -shared -fPIC -nostdlib -o rc.so rc.c $ /lib32/ld-2.13.so --list ./rc.so Inconsistency detected by ld.so: dl-deps.c: 622: _dl_map_object_deps: Assertion `nlist > 1' failed!
2. 64-bit (native arch) works: $ gcc -shared -o rc.so -fPIC -nostdlib rc.c $ ldd ./rc.so statically linked $ gcc -shared -fPIC -o rc.so rc.c $ /lib/ld-2.13.so --list ./rc.so linux-vdso.so.1 => (0x00007fff3a3ff000) libc.so.6 => /lib64/libc.so.6 (0x00007fad662f9000) /lib/ld-2.13.so (0x00007fad668b5000)
still happening with 2.13 ( GIT checkout of @2011-04-04,
'git checkout -f glibc-2.13' ) , for any shared object
for 32-bit sub-arch on x86_64, that is linked with '-nostdlib' :
1. 32-bit fails:
linux- gate.so. 1 => (0xf7757000)
/lib32/ ld-2.13. so (0xf7758000) object_ deps: Assertion `nlist > 1' failed!
$ echo 'int r = 42;' > rc.c
$ gcc -m32 -shared -fPIC -o rc.so rc.c
$ /lib32/ld-2.13.so --list ./rc.so
libc.so.6 => /lib32/libc.so.6 (0xf75d6000)
$ gcc -m32 -shared -fPIC -nostdlib -o rc.so rc.c
$ /lib32/ld-2.13.so --list ./rc.so
Inconsistency detected by ld.so: dl-deps.c: 622: _dl_map_
2. 64-bit (native arch) works:
linux- vdso.so. 1 => (0x00007fff3a3f f000) 9000)
/lib/ld- 2.13.so (0x00007fad668b 5000)
$ gcc -shared -o rc.so -fPIC -nostdlib rc.c
$ ldd ./rc.so
statically linked
$ gcc -shared -fPIC -o rc.so rc.c
$ /lib/ld-2.13.so --list ./rc.so
libc.so.6 => /lib64/libc.so.6 (0x00007fad662f