From 388784cfddc20ada56d3e52f830d6445b14aa3af Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sat, 30 Sep 2017 19:02:57 -0400 Subject: [PATCH] Fix hppa text relocations in libc.so [BZ libc/22165] * sysdeps/unix/sysv/linux/hppa/getcontext.S (__getcontext): Use PIC code to load address of __getcontext_ret when generating PIC code. --- ChangeLog | 6 ++++++ sysdeps/unix/sysv/linux/hppa/getcontext.S | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 37cd69037a..f639d0acb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-09-30 John David Anglin + + [BZ libc/22165] + * sysdeps/unix/sysv/linux/hppa/getcontext.S (__getcontext): Use PIC + code to load address of __getcontext_ret when generating PIC code. + 2017-09-30 H.J. Lu * elf/Makefile (tests-static-internal): Add diff --git a/sysdeps/unix/sysv/linux/hppa/getcontext.S b/sysdeps/unix/sysv/linux/hppa/getcontext.S index 68a74a0b7e..b201d8fda2 100644 --- a/sysdeps/unix/sysv/linux/hppa/getcontext.S +++ b/sysdeps/unix/sysv/linux/hppa/getcontext.S @@ -145,8 +145,13 @@ ENTRY(__getcontext) stw %r4, oR24(%r26) stw %r5, oR25(%r26) stw %r6, oR26(%r26) +#ifdef PIC + addil LT%__getcontext_ret, %r19 + ldw RT%__getcontext_ret(%r1), %r1 +#else ldil L%__getcontext_ret, %r1 ldo R%__getcontext_ret(%r1), %r1 +#endif stw %r1, oR2(%r26) /* Save the current signal mask. */