From f91d3fd64d9b98054f5663a8fb533d15ca9f5943 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Fri, 2 Dec 2016 09:09:55 +0100 Subject: Fix new testcase elf/tst-latepthread on s390x. 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. --- elf/Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'elf') diff --git a/elf/Makefile b/elf/Makefile index 33b003b170..18b3e2a95d 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -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 -- cgit v1.2.3