freebsd-dev/libexec/rtld-elf
Alex Richardson ca7e27bbce rtld: set obj->textsize correctly
With lld-generated binaries the first PT_LOAD will usually be a read-only
segment unless you pass --no-rosegment. For those binaries the textsize is
determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries to
be parsed correctly use the end of the last PT_LOAD that is marked as
executable instead.

I noticed that the value was wrong while adding some debug prints for some rtld
changes for CHERI binaries. `obj->textsize` only seems to be used by PPC so the
effect is untested. However, the value before was definitely wrong and the new
result matches the phdrs.

Reviewed By:	kib
Approved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D17117
2018-10-29 21:08:02 +00:00
..
aarch64 Add STT_GNU_IFUNC and R_AARCH64_IRELATIVE support on arm64. 2018-10-01 14:02:29 +00:00
amd64 o Let rtld(1) set up psABI user trap handlers prior to executing the 2018-02-03 23:14:11 +00:00
arm Rework rtld's TLS Variant I implementation to match r326794 2018-09-05 23:23:16 +00:00
i386 o Let rtld(1) set up psABI user trap handlers prior to executing the 2018-02-03 23:14:11 +00:00
mips Rework rtld's TLS Variant I implementation to match r326794 2018-09-05 23:23:16 +00:00
powerpc This commit reverts 338930. The approach was wrong. 2018-10-01 18:46:35 +00:00
powerpc64 Rework rtld's TLS Variant I implementation to match r326794 2018-09-05 23:23:16 +00:00
riscv Rework rtld's TLS Variant I implementation to match r326794 2018-09-05 23:23:16 +00:00
sparc64 o Let rtld(1) set up psABI user trap handlers prior to executing the 2018-02-03 23:14:11 +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 When doing lm_add(), check for duplicates. 2018-09-26 21:27:08 +00:00
libmap.conf Move libmap.conf to libexec/rtld-elf/ 2018-09-18 00:25:00 +00:00
libmap.h Make the directory mapping functionality, which was previously only 2013-09-21 21:03:52 +00:00
Makefile Move libmap.conf to libexec/rtld-elf/ 2018-09-18 00:25:00 +00:00
Makefile.depend new depends 2015-06-16 23:37:19 +00:00
malloc.c Make sure the rtld(1) error messages go to stderr, not stdout. 2018-08-02 07:43:28 +00:00
map_object.c rtld: set obj->textsize correctly 2018-10-29 21:08:02 +00:00
paths.h Make sure the rtld(1) error messages go to stderr, not stdout. 2018-08-02 07:43:28 +00:00
rtld_lock.c libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
rtld_lock.h libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
rtld_printf.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +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 rtld: set obj->textsize correctly 2018-10-29 21:08:02 +00:00
rtld.h o Let rtld(1) set up psABI user trap handlers prior to executing the 2018-02-03 23:14:11 +00:00
Symbol.map
xmalloc.c libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00