[PATCH v2] elf: Add DL_ADDRESS_WITHOUT_RELOC [BZ #33088]
Alexander Monakov
amonakov@ispras.ru
Mon Jun 16 09:06:01 GMT 2025
On Mon, 16 Jun 2025, H.J. Lu wrote:
> On Mon, Jun 16, 2025 at 4:53 PM Alexander Monakov <amonakov@ispras.ru> wrote:
> >
> >
> > On Mon, 16 Jun 2025, Florian Weimer wrote:
> >
> > > > @@ -428,7 +429,7 @@ static ElfW(Addr) _dl_start_final (void *arg,
> > > >
> > > > /* These are defined magically by the linker. */
> > > > extern const ElfW(Ehdr) __ehdr_start attribute_hidden;
> > > > -extern char _end[] attribute_hidden;
> > > > +extern char _end attribute_hidden;
> > >
> > > Can you avoid this change (which may have unintended side effects on
> > > other architectures) if you use
> > >
> > > > + ({ __typeof (+var) _result = var; asm ("" : "+r"(_result)); _result; })
> > >
> > > in the definition of DL_ADDRESS_WITHOUT_RELOC?
> >
> > It won't work, but __auto_type, available since gcc-4.9 and clang-3.8, will:
> >
> > __auto_type _result = val;
>
> It doesn't work.
Sorry, what didn't work for you? I tested with a small example before replying.
Alexander
More information about the Libc-alpha
mailing list