Hi linted,
thank you for taking a look.
On Wed, Sep 14, 2022 at 12:23 PM linted <linted90(a)gmail.com> wrote:
[Patch 1/5]
I thought this was already submitted and merged in? It looks identical to
"[PATCH v2] static pie: building static PDE", or am I mistaken?
Yes, it's the exact same patch. I'm looking at this uClibc-ng repository:
https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/
and it's not there, so I included it for completeness.
[Patch 2/5]
I'm going to be honest with you, I left that check out because it only affects
xtensia, so it's funny to me that it would bite me this quickly. That said,
reading the code, I'm not sure why xtensia decided to call elf_machine_relative
in PERFORM_BOOTSTRAP_GOT and not use the default code path with
ELF_MACHINE_PLTREL_OVERLAP set to ensure only 1 iteration.
I am not very familiar with xtensia, so there may be some nuance that I'm
not aware of, but I would like your opinion on if we should change xtensia
to conform to how every other architecture seems to perform that relocation.
Yes, I stumbled here too and the same thought crossed my mind. I guess
I should do another pass, try to understand why it's done that way and
clean it up.
[Patch 3/5]
looks good to me.
[Patch 4/5]
I think this removal further implies that we should move the
elf_machine_relative call out of PERFORM_BOOTSTRAP_GOT
as I suggested above.
[Patch 5/5]
I am getting segfaults while still in __uClibc_main when using
buildroot's qemu_xtensa_lx60_defconfig and qemu-xtensa.
I'm not sure the exact cause, but I would guess that some functions
aren't being relocated correctly or the TLS wasn't updated correctly.
It could also possibly be a problem with the quick gcc patch I wrote to
compile with -static-pie. If you have a gcc patch that you think will fix
this as well, I would be glad to test it.
You're right, the following recent binutils and gcc changes are
required for generation of correct relocations and recognition of
the -static-pie option:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=658ba81aef5e8…
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9e0c2696724d4d004ea189a69…
--
Thanks.
-- Max