[PATCH v2] elf: Add optimization barrier for __ehdr_start and _end
H.J. Lu
hjl.tools@gmail.com
Mon Jun 16 07:42:19 GMT 2025
On Mon, Jun 16, 2025 at 3:37 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> >> I think the new test should cover all of ld.so, and only accept the
> >> IRELATIVE relocation and the initialization of _rtld_global_ro, and no
> >> other run-time relocations. (Maybe it has to be restricted to !Hurd,
> >> though.)
> >>
> >
> > We only need to check run-time relocations before ELF_DYNAMIC_RELOCATE.
>
> True, but this rather hard to check in a test. If we work around the
> other cases, too, we can have a reliable test for this issue. I think
> this is important because none of the changes proposed so far address
> the root cause (that x86-64 is a HIDDEN_VAR_NEEDS_DYNAMIC_RELOC
> architecture from GCC's point of view, in the sense that is fine to
> generate run-time relocations for hidden/local objects with the code
> model that we use).
>
> Thanks,
> Florian
rtld is special, which compilers know nothing about. We just need to
list all relocations before ELF_DYNAMIC_RELOCATE. We have
other special handlings to bootstrap ld.so. __ehdr_start and _end
are just 2 of them.
--
H.J.
More information about the Libc-alpha
mailing list