]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hppa: start.S: rework references to fix PIE TEXTRELs [BZ #18421]
authorAlan Modra <amodra@gmail.com>
Sat, 15 Aug 2015 02:15:49 +0000 (22:15 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sun, 24 Jan 2016 08:43:10 +0000 (03:43 -0500)
The startup code was not using PIC friendly references leading to TEXTRELs
in every PIE ELF.

(cherry picked from commit cf4253777412e9c8d5bfbc1c8b975f472e1e7d43)

ChangeLog
NEWS
sysdeps/hppa/start.S

index 4f30c7e00209897a1885f25507d7edd722f16b18..0bde9e21f4eb525643540ac495ee76d0a92c1cb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-08-18  Alan Modra  <amodra@gmail.com>
+
+       [BZ #18421]
+       * sysdeps/hppa/start.S [SHARED]: Use .section .data.rel.ro and define
+       .Lp__global.
+       (_start): Load %dp via .Lp__global.
+       [!SHARED]: Use .section .rodata.
+
 2015-08-09  John David Anglin  <danglin@gcc.gnu.org>
 
        [BZ #18480]
diff --git a/NEWS b/NEWS
index bc2287d2222c3caf6282418283bf1bfb562dc040..99e68d20dee1b1df8a6c14d66a171af5eb6ae71d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,8 +9,8 @@ Version 2.22.1
 
 * The following bugs are resolved with this release:
 
-  17905, 18480, 18589, 18743, 18778, 18781, 18787, 18796, 18870, 18887,
-  18921, 18928, 18969, 18985, 19018, 19058, 19174, 19178.
+  17905, 18421, 18480, 18589, 18743, 18778, 18781, 18787, 18796, 18870,
+  18887, 18921, 18928, 18969, 18985, 19018, 19058, 19174, 19178.
 
 * The LD_POINTER_GUARD environment variable can no longer be used to
   disable the pointer guard feature.  It is always enabled.
index 64d8c3ed6fdcd3d7ae0af9ee9698968545684e39..cc4f243650764136da13812574e1086f62da3e32 100644 (file)
        /* Have the linker create plabel words so we get PLABEL32
           relocs and not 21/14.  The use of 21/14 relocs is only
           supported in the latest dynamic linker.  */
-       .section        .rodata
+#ifdef SHARED
+       .section        .data.rel.ro,"aw",@progbits
+#else
+       .section        .rodata,"a",@progbits
+#endif
        .align 4
 .Lpmain:
        .word P%main
        .word P%__libc_csu_fini
 .Lp__libc_csu_init:
        .word P%__libc_csu_init
+#ifdef SHARED
+.Lp__global:
+       .word $global$
+#endif
 
        .text
        .align 4
@@ -122,10 +130,14 @@ _start:
        /* void *stack_end (7th argument) */
        stw     %sp, -60(%sp)
 
+#ifdef SHARED
+       addil   LT'.Lp__global, %r19
+       ldw     RT'.Lp__global(%r1), %dp
+#else
        /* load global */
        ldil    L%$global$, %dp
        ldo     R%$global$(%dp), %dp
-
+#endif
        bl      __libc_start_main,%r2
        nop
        /* die horribly if it returned (it shouldn't) */