* [COMMITTED] elf: hidden visibility for __minimal_malloc functions
@ 2021-11-16 19:04 Adhemerval Zanella
0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2021-11-16 19:04 UTC (permalink / raw)
To: libc-alpha
Since b05fae4d8e34, __minimal malloc code is used during static
startup before PIE self-relocation (_dl_relocate_static_pie).
So it requires the same fix done for other objects by 47618209d05a.
Checked on aarch64, x86_64, and i686 with and without static-pie.
---
elf/dl-minimal-malloc.c | 5 +++++
1 file changed, 5 insertions(+)
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>
--
2.32.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-16 19:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 19:04 [COMMITTED] elf: hidden visibility for __minimal_malloc functions Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).