_rtld_global, _rtld_global_ro (and local aliases) as an optimization
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Wed Jun 7 12:40:02 GMT 2023
On 07/06/23 09:21, Florian Weimer wrote:
> * Adhemerval Zanella Netto:
>
>> On 07/06/23 06:37, Florian Weimer wrote:
>>> * Andreas Schwab:
>>>
>>>> On Jun 07 2023, Florian Weimer via Libc-alpha wrote:
>>>>
>>>>> As a concrete example, we could turn GLRO(dl_dso_sort_algo) into
>>>>>
>>>>> static int dso_sort_algo;
>>>>>
>>>>> in elf/dl-sort-maps.c because it's not used outside the file.
>>>>
>>>> I think it was just a mistake to put it there initially. None of the
>>>> definitions related to the DSO sort algo (except _dl_sort_maps_init)
>>>> need to be visible outside that file.
>>>
>>> We have more cases that are somewhat similar, where we could use an
>>> extern attribute_hidden variable instead of a struct member. What about
>>> those?
>>
>> I think it makes sense to cleanup the _rtld_global/_rtld_global_ro variables,
>> as Andreas has put there are multiple examples that we shouldn't had to
>> update it.
>
> So the consensus is that we should use this only for cross-DSO
> information sharing, and not for optimizing address computation of
> global data variables?
Which cases are uses solely for optimizing address computation? For, instance
the _dl_pagesize along with _dl_auxv. On Linux, we don't really _dl_pagesize,
but it is simpler and faster than iterate over _dl_auxv.
More information about the Libc-alpha
mailing list