about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@bell.net>2016-06-21 18:35:22 -0400
committerAurelien Jarno <aurelien@aurel32.net>2016-07-01 12:03:03 +0200
commit4b59550eadd3692e4d327363328a41aa5da89af1 (patch)
treea9118565d72a0d68656d75850cc6b6488fb78541
parent19e9aaec52a4b61d208ace8ca952216b7d5c7175 (diff)
downloadglibc-4b59550eadd3692e4d327363328a41aa5da89af1.tar.gz
glibc-4b59550eadd3692e4d327363328a41aa5da89af1.tar.xz
glibc-4b59550eadd3692e4d327363328a41aa5da89af1.zip
hppa: fix loading of global pointer in _start [BZ #20277]
The patched change fixes a regression for executables compiled with the
-p option and linked with gcrt1.o.  The executables crash on startup.

This regression was introduced in 2.22 and was noticed in the gcc testsuite.

(cherry picked from commit 9765ffa71030efd8bb4f2ea4ed6e020fcb4bb714)
-rw-r--r--ChangeLog6
-rw-r--r--NEWS2
-rw-r--r--sysdeps/hppa/start.S2
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 32e31642bd..320cf004e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-06-30  John David Anglin  <danglin@gcc.gnu.org>
+
+	[BZ #20277]
+	* sysdeps/hppa/start.S (_start): Correct loading of global pointer
+	when SHARED is defined.
+
 2016-06-21  Aurelien Jarno  <aurelien@aurel32.net>
 
 	* sysdeps/unix/sysv/linux/mips/vfork.S (__vfork): Rename into
diff --git a/NEWS b/NEWS
index b0b981b1b7..923468dd2e 100644
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@ Version 2.22.1
   17905, 18420, 18421, 18480, 18589, 18743, 18778, 18781, 18787, 18796,
   18870, 18887, 18921, 18928, 18969, 18985, 19003, 19018, 19048, 19058,
   19174, 19178, 19182, 19243, 19573, 19590, 19682, 19791, 19822, 19853,
-  19879, 19779, 20010, 20112.
+  19879, 19779, 20010, 20112, 20277.
 
 * The getnetbyname implementation in nss_dns had a potentially unbounded
   alloca call (in the form of a call to strdupa), leading to a stack
diff --git a/sysdeps/hppa/start.S b/sysdeps/hppa/start.S
index cc4f243650..d20cabafc5 100644
--- a/sysdeps/hppa/start.S
+++ b/sysdeps/hppa/start.S
@@ -131,8 +131,10 @@ _start:
 	stw	%sp, -60(%sp)
 
 #ifdef SHARED
+	/* load global */
 	addil	LT'.Lp__global, %r19
 	ldw	RT'.Lp__global(%r1), %dp
+	ldw	0(%dp), %dp
 #else
 	/* load global */
 	ldil	L%$global$, %dp