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: hjl.tools at gmail 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 15:35:40 +0000

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

--- Comment #35 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to mintsuki from comment #34)

> > The static PIE generated by ldd with non-zero load address won't work with
> > glibc before and after my glibc fix.  I will open an lld issue after glibc
> > is fixed.
> 
> I *strongly* disagree with this.
> 
> Why are glibc implementation details dictating how ld.bfd operates? Where

This is how ELF works on Linux.

> does it say non-0 load addresses for static-PIE/PIE are not allowed in the
> ELF specification? If it is allowed, why is ld.bfd not allowing me to do it

Static PIE isn't the part of ELF spec. There was a discussion:

https://groups.google.com/g/generic-abi/c/mBKlSNldFW4/m/GRddmWGGBQAJ

> despite Limine accepting this form of ELF files just fine?
> 
> At least please consider adding a flag or linker script directive to
> manually set the ELF type...

That will generate the wrong static PIE with non-zero load address.  You should
check DF_1_PIE for PIE, not ET_DYN.

-- 
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]