From d8c2e8e0439b715918ee69b70aab4d222c17e2ca Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 16 Nov 2021 15:58:16 -0300 Subject: elf: hidden visibility for __minimal_malloc functions 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(+) (limited to 'elf') diff --git a/elf/dl-minimal-malloc.c b/elf/dl-minimal-malloc.c index 939b527..ea9bca2 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 . */ +/* 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 #include #include -- cgit v1.1