mirror of git://sourceware.org/git/glibc.git
hppa: start.S: rework references to fix PIE TEXTRELs [BZ #18421]
The startup code was not using PIC friendly references leading to TEXTRELs in every PIE ELF.
This commit is contained in:
parent
352d0eafb6
commit
cf42537774
|
@ -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-18 Mike Frysinger <vapier@gentoo.org>
|
2015-08-18 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/hppa/bits/timerfd.h: New file.
|
* sysdeps/unix/sysv/linux/hppa/bits/timerfd.h: New file.
|
||||||
|
|
|
@ -42,7 +42,11 @@
|
||||||
/* Have the linker create plabel words so we get PLABEL32
|
/* Have the linker create plabel words so we get PLABEL32
|
||||||
relocs and not 21/14. The use of 21/14 relocs is only
|
relocs and not 21/14. The use of 21/14 relocs is only
|
||||||
supported in the latest dynamic linker. */
|
supported in the latest dynamic linker. */
|
||||||
.section .rodata
|
#ifdef SHARED
|
||||||
|
.section .data.rel.ro,"aw",@progbits
|
||||||
|
#else
|
||||||
|
.section .rodata,"a",@progbits
|
||||||
|
#endif
|
||||||
.align 4
|
.align 4
|
||||||
.Lpmain:
|
.Lpmain:
|
||||||
.word P%main
|
.word P%main
|
||||||
|
@ -52,6 +56,10 @@
|
||||||
.word P%__libc_csu_fini
|
.word P%__libc_csu_fini
|
||||||
.Lp__libc_csu_init:
|
.Lp__libc_csu_init:
|
||||||
.word P%__libc_csu_init
|
.word P%__libc_csu_init
|
||||||
|
#ifdef SHARED
|
||||||
|
.Lp__global:
|
||||||
|
.word $global$
|
||||||
|
#endif
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.align 4
|
.align 4
|
||||||
|
@ -122,10 +130,14 @@ _start:
|
||||||
/* void *stack_end (7th argument) */
|
/* void *stack_end (7th argument) */
|
||||||
stw %sp, -60(%sp)
|
stw %sp, -60(%sp)
|
||||||
|
|
||||||
|
#ifdef SHARED
|
||||||
|
addil LT'.Lp__global, %r19
|
||||||
|
ldw RT'.Lp__global(%r1), %dp
|
||||||
|
#else
|
||||||
/* load global */
|
/* load global */
|
||||||
ldil L%$global$, %dp
|
ldil L%$global$, %dp
|
||||||
ldo R%$global$(%dp), %dp
|
ldo R%$global$(%dp), %dp
|
||||||
|
#endif
|
||||||
bl __libc_start_main,%r2
|
bl __libc_start_main,%r2
|
||||||
nop
|
nop
|
||||||
/* die horribly if it returned (it shouldn't) */
|
/* die horribly if it returned (it shouldn't) */
|
||||||
|
|
Loading…
Reference in New Issue