freebsd-src/libexec/rtld-elf
Konstantin Belousov 082f959ac8 Fix several problems with our ELF filters implementation.
Do not relocate twice an object which happens to be needed by loaded
binary (or dso) and some filtee opened due to symbol resolution when
relocating need objects.  Record the state of the relocation
processing in Obj_Entry and short-circuit relocate_objects() if
current object already processed.

Do not call constructors for filtees loaded during the early
relocation processing before image is initialized enough to run
user-provided code.  Filtees are loaded using dlopen_object(), which
normally performs relocation and initialization.  If filtee is
lazy-loaded during the relocation of dso needed by the main object,
dlopen_object() runs too earlier, when most runtime services are not
yet ready.

Postpone the constructors call to the time when main binary and
depended libraries constructors are run, passing the new flag
RTLD_LO_EARLY to dlopen_object().  Symbol lookups callers inform
symlook_* functions about early stage of initialization with
SYMLOOK_EARLY.  Pass flags through all functions participating in
object relocation.

Use the opportunity and fix flags argument to find_symdef() in
arch-specific reloc.c to use proper name SYMLOOK_IN_PLT instead of
true, which happen to have the same numeric value.

Reported and tested by:	theraven
Reviewed by:	kan
MFC after:	2 weeks
2012-03-20 13:20:49 +00:00
..
amd64 Fix several problems with our ELF filters implementation. 2012-03-20 13:20:49 +00:00
arm Fix several problems with our ELF filters implementation. 2012-03-20 13:20:49 +00:00
i386 Fix several problems with our ELF filters implementation. 2012-03-20 13:20:49 +00:00
ia64 Fix several problems with our ELF filters implementation. 2012-03-20 13:20:49 +00:00
mips Fix several problems with our ELF filters implementation. 2012-03-20 13:20:49 +00:00
powerpc Fix several problems with our ELF filters implementation. 2012-03-20 13:20:49 +00:00
powerpc64 Fix several problems with our ELF filters implementation. 2012-03-20 13:20:49 +00:00
sparc64 Fix several problems with our ELF filters implementation. 2012-03-20 13:20:49 +00:00
debug.c Rtld links with the specially built pic static libc library to get some 2011-08-24 20:05:13 +00:00
debug.h Use C99's varadic macro syntax instead of gcc's. 2006-03-28 18:26:47 +00:00
libmap.c Rtld on diet 3. 2012-03-14 15:39:59 +00:00
libmap.h
Makefile Add support for preinit, init and fini arrays. Some ABIs, in 2012-03-11 20:03:09 +00:00
malloc.c Rtld links with the specially built pic static libc library to get some 2011-08-24 20:05:13 +00:00
map_object.c Remove write-only variable. 2012-03-16 19:09:34 +00:00
rtld.1 Implement support for ELF filters in rtld. Both normal and auxillary 2010-12-25 08:51:20 +00:00
rtld.c Fix several problems with our ELF filters implementation. 2012-03-20 13:20:49 +00:00
rtld.h Fix several problems with our ELF filters implementation. 2012-03-20 13:20:49 +00:00
rtld_lock.c Rtld links with the specially built pic static libc library to get some 2011-08-24 20:05:13 +00:00
rtld_lock.h Implement support for ELF filters in rtld. Both normal and auxillary 2010-12-25 08:51:20 +00:00
rtld_printf.c Remove the use of toupper() from rtld_printf.c. Use of the libc function 2012-03-09 16:21:40 +00:00
rtld_printf.h Rtld links with the specially built pic static libc library to get some 2011-08-24 20:05:13 +00:00
rtld_tls.h
Symbol.map Implement fdlopen(3), an rtld interface to load shared object by file 2012-01-07 10:33:01 +00:00
xmalloc.c Rtld links with the specially built pic static libc library to get some 2011-08-24 20:05:13 +00:00