]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
X86_64: Don't use PLT nor GOT in static archives [BZ #20750]
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 28 Nov 2016 17:44:49 +0000 (09:44 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 28 Nov 2016 17:45:07 +0000 (09:45 -0800)
There is no need to use PLT nor GOT in static archives to branch to a
function, regardless whether static archives is compiled with PIC or
not.  When static archives are used to create dynamic executable,
PLT/GOT may be used.  The resulting executable still works correctly.

[BZ #20750]
* sysdeps/x86_64/sysdep.h (JUMPTARGET): Check SHARED instead
of PIC.

ChangeLog
sysdeps/x86_64/sysdep.h

index 0474b4fe6b33190c71d38b9a77e538f6718dca97..ec8b6d88ae655bb3fbaf4b4219fe28ef7c30e1b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-11-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #20750]
+       * sysdeps/x86_64/sysdep.h (JUMPTARGET): Check SHARED instead
+       of PIC.
+
 2016-11-28  Andrew Pinski  <andrew.pinski@caviumnetworks.com>
            Yury Norov  <ynorov@caviumnetworks.com>
            Steve Ellcey  <sellcey@caviumnetworks.com>
index 75ac747be8a8e20cc1c8cac9bf0726d36c30036f..4b67fa80c19acd64b78f3baa477cf2a5d3abec6f 100644 (file)
@@ -89,13 +89,14 @@ lose:                                                                             \
   END (name)
 
 #undef JUMPTARGET
-#ifdef PIC
+#ifdef SHARED
 # ifdef BIND_NOW
 #  define JUMPTARGET(name)     *name##@GOTPCREL(%rip)
 # else
 #  define JUMPTARGET(name)     name##@PLT
 # endif
 #else
+/* For static archives, branch to target directly.  */
 # define JUMPTARGET(name)      name
 #endif