4a1080a9d3
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