fix dl_iterate_phdr in static PIE binaries
authorRich Felker <dalias@aerifal.cx>
Wed, 12 Apr 2017 02:10:52 +0000 (22:10 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 12 Apr 2017 02:10:52 +0000 (22:10 -0400)
commitb3751c3282e3fbae4b97cb4f29031df9bc6e0745
tree64d6d82b860a7ee440fc5b6500adfed690dee3e0
parent1ca597551bab424a1302938dd3504ddf73904efd
fix dl_iterate_phdr in static PIE binaries

analogous to commit 5bf7eba213cacc4c1220627c91c28deff2ffecda, use of
AT_PHDR/PT_PHDR does not actually work to find the program base, and
the method with _DYNAMIC vs PT_DYNAMIC must be used as an alternative.

patch by Shiz, along with testing to confirm that this fixes unwinding
in static PIE.
src/ldso/dl_iterate_phdr.c