public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] S390: Support PLT and GOT references in check-localplt.
@ 2016-08-09 13:35 Stefan Liebler
  2016-08-09 13:53 ` Florian Weimer
  2016-08-17  8:22 ` Stefan Liebler
  0 siblings, 2 replies; 12+ messages in thread
From: Stefan Liebler @ 2016-08-09 13:35 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

Hi,

on s390x the test elf/check-localplt is failing after recent commits:
"elf: Do not use memalign for TCB/TLS blocks allocation [BZ #17730]"
"elf: Avoid using memalign for TLS allocations [BZ #17730]"
"elf: dl-minimal malloc needs to respect fundamental alignment"
due to "Missing required PLT reference: ld.so: __libc_memalign".

After the commits __libc_memalign is only called in elf/dl-minimal.c in 
malloc() function in ld.so and gcc -O2/-O3 leads to R_390_GLOB_DAT 
instead of R_390_JMP_SLOT. __libc_memalign is called via 
function-pointer loaded from GOT instead of calling via a plt-stub. In 
this case there is the R_390_GLOB_DAT relocation in section .rela.dyn 
instead of R_390_JMP_SLOT in .rela.plt.
This patch marks ld.so: __libc_memalign with R_390_GLOB_DAT in 
localplt.data to allow both relocations.
If build with -fno-optimize-sibling-calls or on s390(31bit) a 
R_390_JMP_SLOT is generated.

Okay to commit?

Bye
Stefan

ChangeLog:

	* sysdeps/unix/sysv/linux/s390/localplt.data: Mark
	ld.so: __libc_memalign with "+ RELA R_390_GLOB_DAT".

[-- Attachment #2: 20160809_checklocalplt___libc_memalign.patch --]
[-- Type: text/x-patch, Size: 1072 bytes --]

diff --git a/sysdeps/unix/sysv/linux/s390/localplt.data b/sysdeps/unix/sysv/linux/s390/localplt.data
index b25abf8..1226413 100644
--- a/sysdeps/unix/sysv/linux/s390/localplt.data
+++ b/sysdeps/unix/sysv/linux/s390/localplt.data
@@ -8,7 +8,14 @@ libm.so: matherr
 # The dynamic loader uses __libc_memalign internally to allocate aligned
 # TLS storage. The other malloc family of functions are expected to allow
 # user symbol interposition.
-ld.so: __libc_memalign
+# It is also allowed to call __libc_memalign via function-pointer loaded from
+# GOT instead of calling via a plt-stub. In this case there is a R_390_GLOB_DAT
+# relocation in section .rela.dyn instead of R_390_JMP_SLOT in .rela.plt.
+# After commit "elf: Do not use memalign for TCB/TLS blocks allocation
+# [BZ #17730]" __libc_memalign is only called in elf/dl-minimal.c: malloc() in
+# ld.so and gcc -O2/-O3 leads to R_390_GLOB_DAT. If build with
+# -fno-optimize-sibling-calls an R_390_JMP_SLOT is generated.
+ld.so: __libc_memalign + RELA R_390_GLOB_DAT
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-09-06 12:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-09 13:35 [PATCH] S390: Support PLT and GOT references in check-localplt Stefan Liebler
2016-08-09 13:53 ` Florian Weimer
2016-08-09 14:22   ` Stefan Liebler
2016-08-17 13:48     ` Florian Weimer
2016-08-18 10:42       ` Stefan Liebler
2016-08-23 11:28         ` Stefan Liebler
2016-08-26 11:50           ` Florian Weimer
2016-08-30 15:52             ` Stefan Liebler
2016-09-05  7:09               ` Stefan Liebler
2016-09-05  7:23                 ` Florian Weimer
2016-09-06 12:47                   ` Stefan Liebler
2016-08-17  8:22 ` Stefan Liebler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).