bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when lo


From: mintsuki at protonmail dot com
Subject: [Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0
Date: Sun, 26 May 2024 14:58:28 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=31795

--- Comment #32 from mintsuki <mintsuki at protonmail dot com> ---
(In reply to H.J. Lu from comment #31)
> (In reply to mintsuki from comment #30)
> > Basically, it tries to find a PHDR which contains the RELA section, and if
> > it find it, it subtracts the PHDR's virtual address and adds its offset in
> > order to find the offset of the RELA section inside the ELF file itself.
> 
> In glibc, we know it is a static PIE.  We relocate PT_DYNAMIC segment only if
> it is ET_DYN.

So what is the issue? And in any case, it doesn't feel right to me to have this
behaviour in ld just to work around quirks of a specific ELF loader out of
many.

If anything, it needs to be handled in glibc, and the behaviour of ld should be
reverted to match gold and lld.

Just my opinion of course.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]