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 --- sysdeps/nios2/configure | 3 +++ sysdeps/nios2/configure.ac | 2 ++ 2 files changed, 5 insertions(+) (limited to 'sysdeps/nios2') diff --git a/sysdeps/nios2/configure b/sysdeps/nios2/configure index 14c8a3a014..b3cd28349e 100644 --- a/sysdeps/nios2/configure +++ b/sysdeps/nios2/configure @@ -160,3 +160,6 @@ $as_echo "$libc_cv_nios2_be" >&6; } if test $libc_cv_nios2_be = yes; then as_fn_error $? "Big endian not supported for Nios II" "$LINENO" 5 fi + +$as_echo "#define HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 1" >>confdefs.h + diff --git a/sysdeps/nios2/configure.ac b/sysdeps/nios2/configure.ac index f05f43802b..f738e9a7ed 100644 --- a/sysdeps/nios2/configure.ac +++ b/sysdeps/nios2/configure.ac @@ -11,3 +11,5 @@ AC_CACHE_CHECK([for big endian], if test $libc_cv_nios2_be = yes; then AC_MSG_ERROR([Big endian not supported for Nios II]) fi + +AC_DEFINE(HIDDEN_VAR_NEEDS_DYNAMIC_RELOC) -- cgit 1.4.1