about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--elf/dl-minimal-malloc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/elf/dl-minimal-malloc.c b/elf/dl-minimal-malloc.c
index 939b5271ca..ea9bca26cf 100644
--- a/elf/dl-minimal-malloc.c
+++ b/elf/dl-minimal-malloc.c
@@ -17,6 +17,11 @@
    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.
+    Note: string.h may have ifuncs which cannot be hidden on i686.  */
+#if BUILD_PIE_DEFAULT
+# pragma GCC visibility push(hidden)
+#endif
 #include <assert.h>
 #include <string.h>
 #include <ldsodefs.h>