freebsd-skq/libexec/rtld-elf
emaste 33a9dab77f Add WITH_PIE knob to build Position Independent Executables
Building binaries as PIE allows the executable itself to be loaded at a
random address when ASLR is enabled (not just its shared libraries).

With this change PIE objects have a .pieo extension and INTERNALLIB
libraries libXXX_pie.a.

MK_PIE is disabled for some kerberos5 tools, Clang, and Subversion, as
they explicitly reference .a libraries in their Makefiles.  These can
be addressed on an individual basis later.  MK_PIE is also disabled for
rtld-elf because it is already position-independent using bespoke
Makefile rules.

Currently only dynamically linked binaries will be built as PIE.

Discussed with:	dim
Reviewed by:	kib
MFC after:	1 month
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18423
2019-02-15 22:22:38 +00:00
..
aarch64 Improve R_AARCH64_TLSDESC relocation. 2018-12-15 10:38:07 +00:00
amd64 Improve R_AARCH64_TLSDESC relocation. 2018-12-15 10:38:07 +00:00
arm Improve R_AARCH64_TLSDESC relocation. 2018-12-15 10:38:07 +00:00
i386 rtld: pacify -Wmaybe-uninitialized from gcc6 2019-02-01 23:16:59 +00:00
mips Improve R_AARCH64_TLSDESC relocation. 2018-12-15 10:38:07 +00:00
powerpc Improve R_AARCH64_TLSDESC relocation. 2018-12-15 10:38:07 +00:00
powerpc64 Fix rtld-elf compilation warning for powerpc64 ELFv2 ABI 2019-01-13 02:33:20 +00:00
riscv Improve R_AARCH64_TLSDESC relocation. 2018-12-15 10:38:07 +00:00
sparc64 Improve R_AARCH64_TLSDESC relocation. 2018-12-15 10:38:07 +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 Add WITH_PIE knob to build Position Independent Executables 2019-02-15 22:22:38 +00:00
Makefile.depend new depends 2015-06-16 23:37:19 +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_malloc.c Rename rtld-elf/malloc.c to rtld-elf/rtld_malloc.c. 2019-01-30 16:28:27 +00:00
rtld_malloc.h Add header file missed in r343564. 2019-01-29 22:45:24 +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 Adjust posix symbols from rtld-elf/malloc.c with the __crt_ prefix. 2019-01-29 22:40:42 +00:00
rtld.h Adjust posix symbols from rtld-elf/malloc.c with the __crt_ prefix. 2019-01-29 22:40:42 +00:00
Symbol.map Add rtld private interface for dso to detect dynamic loading 2015-01-03 18:09:53 +00:00
xmalloc.c Adjust posix symbols from rtld-elf/malloc.c with the __crt_ prefix. 2019-01-29 22:40:42 +00:00