[PATCH v2] elf: Inline do_tunable_update_val/tunable_initialize [BZ #28712]

Florian Weimer fweimer@redhat.com
Sat Dec 18 22:46:06 GMT 2021


* H. J. Lu via Libc-alpha:

> Inline do_tunable_update_val and tunable_initialize to prevent compiler
> from generating dynamic relocation against tunable_list which causes
> __tunables_init to fail in static PIE on x86-64:
>
> FAIL: elf/tst-env-setuid
>
> since
>
> .L35:
>         movq    $-88, %rax
>         subq    .LC3(%rip), %rax
> 	^^^^  This is executed before the .LC3 entry has been relocated.
>         movq    %rax, 8(%rsp)
> ...
>         .section        .data.rel.ro.local,"aw"
>         .align 8
> .LC3:
>         .quad   tunable_list
>
> Tested on x86-64, x32 and i686 with GCC 11 and GCC 12.

This is a GCC bug that needs to be fixed, or we have to
PI_STATIC_AND_HIDDEN as 0 on x86-64, which has lots of unwanted
consequences.

Thanks,
Florian



More information about the Libc-alpha mailing list