aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-reloc-static-pie.c2
-rw-r--r--elf/dl-support.c6
-rw-r--r--elf/dl-tunables.c4
-rw-r--r--elf/enbl-secure.c4
4 files changed, 16 insertions, 0 deletions
diff --git a/elf/dl-reloc-static-pie.c b/elf/dl-reloc-static-pie.c
index a8d9640..d5bd2f3 100644
--- a/elf/dl-reloc-static-pie.c
+++ b/elf/dl-reloc-static-pie.c
@@ -17,6 +17,8 @@
<https://www.gnu.org/licenses/>. */
#if ENABLE_STATIC_PIE
+/* Mark symbols hidden in static PIE for early self relocation to work. */
+# pragma GCC visibility push(hidden)
#include <unistd.h>
#include <ldsodefs.h>
#include "dynamic-link.h"
diff --git a/elf/dl-support.c b/elf/dl-support.c
index 2434c47..7abb65d 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -19,6 +19,12 @@
/* This file defines some things that for the dynamic linker are defined in
rtld.c and dl-sysdep.c in ways appropriate to bootstrap dynamic linking. */
+#include <string.h>
+/* Mark symbols hidden in static PIE for early self relocation to work.
+ Note: string.h may have ifuncs which cannot be hidden on i686. */
+#if BUILD_PIE_DEFAULT
+# pragma GCC visibility push(hidden)
+#endif
#include <errno.h>
#include <libintl.h>
#include <stdlib.h>
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
index e44476f..b1a50b8 100644
--- a/elf/dl-tunables.c
+++ b/elf/dl-tunables.c
@@ -18,6 +18,10 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+/* Mark symbols hidden in static PIE for early self relocation to work. */
+#if BUILD_PIE_DEFAULT
+# pragma GCC visibility push(hidden)
+#endif
#include <startup.h>
#include <stdint.h>
#include <stdbool.h>
diff --git a/elf/enbl-secure.c b/elf/enbl-secure.c
index 5dcf649..9e47526 100644
--- a/elf/enbl-secure.c
+++ b/elf/enbl-secure.c
@@ -19,6 +19,10 @@
/* This file is used in the static libc. For the shared library,
dl-sysdep.c defines and initializes __libc_enable_secure. */
+/* Mark symbols hidden in static PIE for early self relocation to work. */
+#if BUILD_PIE_DEFAULT
+# pragma GCC visibility push(hidden)
+#endif
#include <startup.h>
#include <libc-internal.h>