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 --- config.h.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config.h.in') diff --git a/config.h.in b/config.h.in index a94f756859..916465fce8 100644 --- a/config.h.in +++ b/config.h.in @@ -84,9 +84,9 @@ /* Define if the compiler\'s exception support is based on libunwind. */ #undef HAVE_CC_WITH_LIBUNWIND -/* Define if the access to static and hidden variables is position independent - and does not need relocations. */ -#undef PI_STATIC_AND_HIDDEN +/* Define if the accesses to static and hidden variables in a shared object + need dynamic relocations. */ +#undef HIDDEN_VAR_NEEDS_DYNAMIC_RELOC /* Define this to disable the 'hidden_proto' et al macros in include/libc-symbols.h that avoid PLT slots in PIE. */ -- cgit 1.4.1