[Bug target/88627] Gcc -N -nostdlib Now includes PT_INTERP Which causes auxv fetching to fail due to out of range PT_PHDR

ryan at bitlackeys dot org gcc-bugzilla@gcc.gnu.org
Sun Dec 30 07:17:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88627

--- Comment #2 from Ryan <ryan at bitlackeys dot org> ---
I can understand that (even though previous behavior was different).
However, the PT_PHDR segment should still always exist within the range of
a LOAD segment since the dynamic linker relies on the auxv entry AT_PHDR to
locate the program header table. So as far as I can tell, this is still a
problem with gcc or ld, but not ld.so. ld.so is doing what its expected,
which is to count on the fact that the program header table will be loaded
into memory (via within the range of a LOAD segment). The kernel doesn't
rely on the auxv to find AT_PHDR so its OK with the kernel, but it causes
issues with the dynamic linker. The main issue here is that PT_PHDR needs
to be placed within the range of a LOAD segment.

-Ryan

On Thu, Dec 27, 2018 at 7:34 PM pinskia at gcc dot gnu.org <
gcc-bugzilla@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88627
>
> --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> Without -static or your own -dynamic-linker option, it will always include
> the
> dynamic linker (loader).
>
> If there is an out of range PT_PHDR, then the bug is in the dynamic linker
> rather than GCC.
>
> --
> You are receiving this mail because:
> You reported the bug.


More information about the Gcc-bugs mailing list