Message ID | 20211218202743.3105160-1-hjl.tools@gmail.com |
---|---|
State | Dropped |
Headers | show |
Series | [v2] elf: Inline do_tunable_update_val/tunable_initialize [BZ #28712] | expand |
Context | Check | Description |
---|---|---|
dj/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
dj/TryBot-32bit | success | Build for i686 |
* 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
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c index 497e948f1c..02402e2990 100644 --- a/elf/dl-tunables.c +++ b/elf/dl-tunables.c @@ -92,7 +92,7 @@ get_next_env (char **envp, char **name, size_t *namelen, char **val, return NULL; } -static void +static void __always_inline do_tunable_update_val (tunable_t *cur, const tunable_val_t *valp, const tunable_num_t *minp, const tunable_num_t *maxp) @@ -139,7 +139,7 @@ do_tunable_update_val (tunable_t *cur, const tunable_val_t *valp, /* Validate range of the input value and initialize the tunable CUR if it looks good. */ -static void +static void __always_inline tunable_initialize (tunable_t *cur, const char *strval) { tunable_val_t val;