before referencing object's DAG. This makes it possible for
C++ exceptions to work across shared libraries.
Patch taken from FreeBSD: src/libexec/rtld-elf/rtld.c: 1.67 -> 1.68,
committed there by kan@FreeBSD.org.
* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.
* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.
Previously dlsym resolved to the version in crt0.o or libc which would
mean that the caller's shared object couldn't be determined correctly
using __builtin_return_address(0).
Mainly from FreeBSD, but adapted by me. Benefits of this solutions are:
- backward comptibility maintained
- existing broken binaries are fixed with a new ld.elf_so
- __mainprog_obj can be removed from crt0.o
- we do the same thing as FreeBSD
Fixes PR 22067.
OKed by Jason and Christos.
With the latest SuperH toolchain, NetBSD/evbsh5 can now
run with a fully dynamic userland (modulo a few remaining
gremlins affecting a couple of binaries).
the beginning of the GOT, so we don't need an extra one here. Also, remove a
bogus comment -- we do in fact have to do fixups, because there are pointers in
ld.elf_so's data segment that need to be relocated.
first entry, which is a special case) in rtld_start, because they could be
all 0s. Instead we use the difference between the real _DYNAMIC address
(which we can determine on 68k with a "lea (%pc,_DYNAMIC),..." and the
base-relative one (at the beginning of the GOT) to figure out the relocation
offset.
Not needed for binutils-current, but I might as well fix it now.
disassembling a call to _DYNAMIC to determine its real address, and using the
first entry of the GOT as its base-relative address.
It's evil, but it works.