From 4b59550eadd3692e4d327363328a41aa5da89af1 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Tue, 21 Jun 2016 18:35:22 -0400 Subject: 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) --- ChangeLog | 6 ++++++ NEWS | 2 +- sysdeps/hppa/start.S | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 32e31642bd..320cf004e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-06-30 John David Anglin + + [BZ #20277] + * sysdeps/hppa/start.S (_start): Correct loading of global pointer + when SHARED is defined. + 2016-06-21 Aurelien Jarno * 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 -- cgit 1.4.1