PowerPC64 DT_RELR
H.J. Lu
hjl.tools@gmail.com
Sun Jan 23 13:51:00 GMT 2022
On Fri, Jan 21, 2022 at 8:28 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Wed, Jan 19, 2022 at 02:56:07PM -0800, H.J. Lu wrote:
> > Does PowerPC64 support static PIE? If yes, it may need more linker changes.
>
> No. There are things in glibc that need fixing. We have small-model
> toc relocs being used in assembly. This results in the linker
> refusing to do toc/got indirect to toc pointer relative code
> optimisation for those sequences. So we get toc/got entries with
> relative relocations that result in segfaults when static-pie binaries
> are trying to relocate themselves.
If you just want to get static PIE working, you can simply assume that any
files in libc.a may be used in ld.so, which is almost a static PIE. This was
how I implemented static PIE in glibc. Of course, this may expose linker
bugs:
https://sourceware.org/bugzilla/show_bug.cgi?id=21782
https://sourceware.org/bugzilla/show_bug.cgi?id=22269
https://sourceware.org/bugzilla/show_bug.cgi?id=22263
--
H.J.
More information about the Binutils
mailing list