From 098a657fe449a217cf65c5270d5fbc8d40b5b4e6 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 26 Apr 2022 09:26:22 -0700 Subject: elf: Replace PI_STATIC_AND_HIDDEN with opposite HIDDEN_VAR_NEEDS_DYNAMIC_RELOC PI_STATIC_AND_HIDDEN indicates whether accesses to internal linkage variables and hidden visibility variables in a shared object (ld.so) need dynamic relocations (usually R_*_RELATIVE). PI (position independent) in the macro name is a misnomer: a code sequence using GOT is typically position-independent as well, but using dynamic relocations does not meet the requirement. Not defining PI_STATIC_AND_HIDDEN is legacy and we expect that all new ports will define PI_STATIC_AND_HIDDEN. Current ports defining PI_STATIC_AND_HIDDEN are more than the opposite. Change the configure default. No functional change. Reviewed-by: Adhemerval Zanella --- elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'elf') diff --git a/elf/rtld.c b/elf/rtld.c index 93180466d6..be6daa1c44 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -424,7 +424,7 @@ DL_SYSINFO_IMPLEMENTATION is fine, too. The latter is important here. We can avoid setting up a temporary link map for ld.so if we can mark _rtld_global as hidden. */ -#ifdef PI_STATIC_AND_HIDDEN +#ifndef HIDDEN_VAR_NEEDS_DYNAMIC_RELOC # define DONT_USE_BOOTSTRAP_MAP 1 #endif -- cgit v1.2.3