]> sourceware.org Git - glibc.git/commitdiff
Enable hidden visibility in libc.a compiled with PIE
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 21 Aug 2017 12:47:10 +0000 (05:47 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 21 Aug 2017 12:47:27 +0000 (05:47 -0700)
When building libc.a with PIE, enable hidden visibility to allow direct
access to definitions within libc.a without using GOT.

Size comparison of elf/ldconfig when the compiler defaults to -fPIE:

On x86-64:
        text    data     bss     dec     hex
Before: 619206   20132    5488  644826   9d6da
After : 619062   20132    5488  644682   9d64a
On i686:
        text    data     bss     dec     hex
Before: 556305   10816    3056  570177   8b341
After : 553688   10756    3056  567500   8a8cc

* include/libc-symbols.h (attribute_hidden): Enable hidden
visibility in libc.a compiled with PIE.

ChangeLog
include/libc-symbols.h

index d25a8fd56c0dd86539c0e81696fb5e75577af0d4..e7ffb591b1af7ac01749b08799fec786770fce38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * include/libc-symbols.h (attribute_hidden): Enable hidden
+       visibility in libc.a compiled with PIE.
+
 2017-08-21  H.J. Lu  <hongjiu.lu@intel.com>
 
        [BZ #18822]
index fe3ab81c51ec2711da88dc60478416b8be056cb9..d6a1c260f6cb80aacd16c9b1b991559421419cf3 100644 (file)
@@ -363,7 +363,8 @@ for linking")
   strong_alias(real, name)
 #endif
 
-#if defined SHARED || defined LIBC_NONSHARED
+#if defined SHARED || defined LIBC_NONSHARED \
+  || (BUILD_PIE_DEFAULT && IS_IN (libc))
 # define attribute_hidden __attribute__ ((visibility ("hidden")))
 #else
 # define attribute_hidden
This page took 0.048315 seconds and 5 git commands to generate.