]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: hidden visibility for __minimal_malloc functions
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 16 Nov 2021 18:58:16 +0000 (15:58 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 16 Nov 2021 19:03:31 +0000 (16:03 -0300)
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

index 939b5271ca609171332fd147e63fa221cc0cc053..ea9bca26cf2623b2aee18658fccac795d5ece07d 100644 (file)
    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>