freebsd-dev/libexec/rtld-elf
Konstantin Belousov 4903c73faf Some fixes for LD_BIND_NOW + ifuncs.
- Do not perform ifunc relocations together with other PLT relocations
  in PLT.  Instead, do it during an additional pass over the init
  list, so that ifuncs are resolved in the order of dso
  dependencies. This allows the ifuncs resolvers to call into depended
  libs.  Init list now includes all objects instead of only objects
  with init/fini callables.
- Disable relro protection around bind_now ifunc relocations.

I considered calling ifunc resolvers of dso after initializers of all
dependencies are processed, and decided that this is wrong/should not
be supported. The order now is normal relocations for all
objects->ifunc resolution in init order->initializers, where each step
does complete pass over all loaded objects before moving to the next
step.

Reported, tested and reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D18400
2018-12-03 20:03:43 +00:00
..
aarch64 rtld-elf: compile with WANRS=4 warnings other than -Wcast-align 2018-10-29 21:08:19 +00:00
amd64 Silence gcc warnings. 2018-11-23 18:15:23 +00:00
arm rtld-elf: compile with WANRS=4 warnings other than -Wcast-align 2018-10-29 21:08:19 +00:00
i386 rtld-elf: compile with WANRS=4 warnings other than -Wcast-align 2018-10-29 21:08:19 +00:00
mips rtld-elf: compile with WANRS=4 warnings other than -Wcast-align 2018-10-29 21:08:19 +00:00
powerpc Flush data cache for executable loadable segments explicitly. 2018-11-03 20:39:16 +00:00
powerpc64 Flush data cache for executable loadable segments explicitly. 2018-11-03 20:39:16 +00:00
riscv rtld-elf: fix more warnings to allow compiling with WARNS=6 2018-10-29 21:08:28 +00:00
sparc64 rtld-elf: compile with WANRS=4 warnings other than -Wcast-align 2018-10-29 21:08:19 +00:00
tests Fix regression tests broken by r337067. 2018-08-02 11:55:16 +00:00
debug.c libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
debug.h libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
libmap.c rtld-elf: fix more warnings to allow compiling with WARNS=6 2018-10-29 21:08:28 +00:00
libmap.conf Move libmap.conf to libexec/rtld-elf/ 2018-09-18 00:25:00 +00:00
libmap.h rtld-elf: make it compile with WARNS=3 2018-10-29 21:08:11 +00:00
Makefile disable BIND_NOW in libc, libthr, and rtld 2018-12-03 15:59:46 +00:00
Makefile.depend new depends 2015-06-16 23:37:19 +00:00
malloc.c rtld-elf: fix more warnings to allow compiling with WARNS=6 2018-10-29 21:08:28 +00:00
map_object.c Remove Obj_Entry textsize member. 2018-11-04 00:32:28 +00:00
paths.h rtld-elf: compile with WANRS=4 warnings other than -Wcast-align 2018-10-29 21:08:19 +00:00
rtld_lock.c rtld-elf: fix more warnings to allow compiling with WARNS=6 2018-10-29 21:08:28 +00:00
rtld_lock.h libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
rtld_printf.c rtld-elf: fix more warnings to allow compiling with WARNS=6 2018-10-29 21:08:28 +00:00
rtld_printf.h libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
rtld_tls.h libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
rtld_utrace.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
rtld.1 Add serial comma. 2017-09-01 16:56:37 +00:00
rtld.c Some fixes for LD_BIND_NOW + ifuncs. 2018-12-03 20:03:43 +00:00
rtld.h Some fixes for LD_BIND_NOW + ifuncs. 2018-12-03 20:03:43 +00:00
Symbol.map Add rtld private interface for dso to detect dynamic loading 2015-01-03 18:09:53 +00:00
xmalloc.c libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00