[PATCH 2/3] [RFC] elf: hack up tunables to avoid RELATIVE relocs

Siddhesh Poyarekar siddhesh@gotplt.org
Thu Jan 7 13:50:06 GMT 2021


On 1/7/21 4:31 PM, Szabolcs Nagy via Libc-alpha wrote:
> With static pie linking pointers in the tunables list need
> RELATIVE relocs since the absolute address is not known at
> link time.
> 
> This is a hack to avoid relocs in tunables so the static pie
> self relocation can be done later.
> 
> The longest tunable name is currently
>    glibc.elision.skip_trylock_internal_abort
> and the longest env var alias is
>    MALLOC_MMAP_THRESHOLD_
> There are likely ways to have a compact pointer-free tunable
> list data structure with more gen-tunables.awk changes, but
> before that i would like to get feedback if this approach
> for bug 27072 is acceptable.

I think this is a good idea independently of the rest of the patchset. 
The only change I'd like is to make name 64 bytes and env_alias 24 
bytes.  We don't have any additional environment variables to convert 
into tunables, so the max length of MALLOC_MMAP_THRESHOLD_ is about as 
big as it can get.

Siddhesh



More information about the Libc-alpha mailing list