]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix new testcase elf/tst-latepthread on s390x.
authorStefan Liebler <stli@linux.vnet.ibm.com>
Fri, 2 Dec 2016 08:09:55 +0000 (09:09 +0100)
committerStefan Liebler <stli@linux.vnet.ibm.com>
Fri, 2 Dec 2016 08:09:55 +0000 (09:09 +0100)
The first dlopen ("tst-latepthreadmod.so", RTLD_LOCAL | RTLD_LAZY) call
in elf/tst-latepthread.c fails on s390x with "error: dlopen failed:
.../build-s390x/elf/tst-latepthreadmod.so:
undefined symbol: this_function_is_not_defined".

In elf/tst-latepthreadmod.c, this_function_is_not_defined is a sibling
call which leads to a R_390_GLOB_DAT relocation in .rela.dyn instead of
a R_390_JMP_SLOT in .rela.plt.

As RTLD_LAZY skips the JMP_SLOT relocations, but not GLOB_DAT ones,
the dlopen call fails. If elf/tst-latepthreadmod.c is build with
-fno-optimize-sibling-calls, a JMP_SLOT relocation is generated for
this_function_is_not_defined and the test passes.

ChangeLog:

* elf/Makefile (CFLAGS-tst-latepthreadmod.c):
Add -fno-optimize-sibling-calls.

ChangeLog
elf/Makefile

index 62e49bb03aad343276ed2512b29805ddce597d80..f42d0c574d87f83e58c7d33b76e7bfb1c748cf57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-02  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
+       * elf/Makefile (CFLAGS-tst-latepthreadmod.c):
+       Add -fno-optimize-sibling-calls.
+
 2016-12-02  Joseph Myers  <joseph@codesourcery.com>
 
        * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (llogb):
index 33b003b170e1f42e82cc1a5c24438590919727ab..18b3e2a95d8359f2f2a1f991c6033dae203f5b77 100644 (file)
@@ -1271,6 +1271,9 @@ LDFLAGS-tst-audit12mod2.so = -Wl,--version-script=tst-audit12mod2.map
 # Force lazy binding for the same reason.
 LDFLAGS-tst-latepthreadmod.so = \
   -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all
+# Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
+# function this_function_is_not_defined.
+CFLAGS-tst-latepthreadmod.c = -fno-optimize-sibling-calls
 $(objpfx)tst-latepthreadmod.so: $(shared-thread-library)
 $(objpfx)tst-latepthread: $(libdl)
 $(objpfx)tst-latepthread.out: $(objpfx)tst-latepthreadmod.so