[PATCH v2] elf: Add optimization barrier for __ehdr_start and _end
Jakub Jelinek
jakub@redhat.com
Mon Jun 16 07:03:28 GMT 2025
On Mon, Jun 16, 2025 at 09:55:38AM +0300, Alexander Monakov wrote:
> > So just make it
> > _dl_rtld_map.l_map_start = (ElfW(Addr)) &__ehdr_start;
> > + asm ("" : "=m" (_dl_rtld_map) : "m" (_dl_rtld_map));
> > _dl_rtld_map.l_map_end = (ElfW(Addr)) _end;
> > + asm ("" : "=m" (_dl_rtld_map) : "m" (_dl_rtld_map));
>
> In this case, either just the first asm is sufficient to break up this
> vectorizable pair, or additional such asm is necessary in the beginning to
> prevent forming a pair with l_map_start and the preceding field, just like
> the second asm prevents forming a pair out of l_map_end and the next field.
Yes. Just one in the middle will fix the current problem.
And as the preceding and following members are l_origin and l_scope_mem,
neither of which is stored in rtld.c, I think just one will be enough for
the stores in that area.
Jakub
More information about the Libc-alpha
mailing list