aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-11-28 09:44:49 -0800
committerH.J. Lu <hjl.tools@gmail.com>2016-11-28 09:45:07 -0800
commitc9070e6305c08365c5f8b604bdca39c699d70cfa (patch)
treeca1d9aec72ad11a8530e4fcef99d6a7deb576cda
parent389d1f1b232b3d6b9d73ee2c50e543ace6675621 (diff)
downloadglibc-c9070e6305c08365c5f8b604bdca39c699d70cfa.zip
glibc-c9070e6305c08365c5f8b604bdca39c699d70cfa.tar.gz
glibc-c9070e6305c08365c5f8b604bdca39c699d70cfa.tar.bz2
X86_64: Don't use PLT nor GOT in static archives [BZ #20750]
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.
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/x86_64/sysdep.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0474b4f..ec8b6d8 100644
--- 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>
diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h
index 75ac747..4b67fa8 100644
--- a/sysdeps/x86_64/sysdep.h
+++ b/sysdeps/x86_64/sysdep.h
@@ -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