ldd on a go binary currently fails with an error that basically
says "not elf32 class". this is a true statement, as it is an
elf64 class object, but it's not useful. it happens because
ldd_elf64() is called, fails in _rtld_map_object(), and then
ldd_elf32() is called, and it fails because the class is wrong,
and only this error is returned. (this problem remains. the
call to map the object fails due to there being 3 instead of 2
elf segments in the file. i guess we need similar code in
ld.elf_so/map_objects.c as the kernel gained some time ago.)
perhaps the first error, not the last error, should be used if
everything fails, but this allows all failures to be see and
would be useful even if the error string handling changed.
These utilities (elf32, elf32_compat, elf64, liblldb) share code with the
ELF dynamic loader that is not being sanitized and its symbols are
installed into sanitized programs (in particular __tls_get_addr()).
Additionally libldd is used in rescue that is not expected to be sanitized
as of today.
with this ldd can handle both 64 and n32 binaries ( previously it would do 64
only ), o32 support is still broken
Someone more familiar with this code needs to fix this properly.
_rtld_tls_allocate and _rtld_tls_free. libpthread uses this functions to
setup the thread private area of all new threads. ld.elf_so is
responsible for setting up the private area for the initial thread.
Similar functions are called from _libc_init for static binaries, using
dl_iterate_phdr to access the ELF Program Header.
Add test cases to exercise the different TLS storage models. Test cases
are compiled and installed on all platforms, but are skipped on
platforms not marked for TLS support.
This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
It is inspired by the TLS support in FreeBSD by Doug Rabson and the
clean ups of the DragonFly port of the original FreeBSD modifications.
for mips64 to build this with MLIBDIR set to o32
- make mips64 ldd call elf32_compat_ldd as well
- make mips64 elf64 set MLIBDIR to 64
- don't need ld.elf_so's Makefile.ld32 files anymore (they are going away
soon anyway)
tested on amd64 and sparc64, and an earlier version tested on mips64.