[PATCH v2] elf: Add DL_ADDRESS_WITHOUT_RELOC [BZ #33088]
Florian Weimer
fweimer@redhat.com
Mon Jun 16 09:15:41 GMT 2025
* Alexander Monakov:
> 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;
>
> or something like '__typeof(0 ? val : 0)' can be used for
> array-to-pointer decay inside of typeof.
Why doesn't it work? Shouldn't the + trigger decay from array to
pointer? Maybe it needs another one?
Thanks,
Florian
More information about the Libc-alpha
mailing list