From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2191) id 149353858D38; Wed, 10 Jan 2024 21:16:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 149353858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704921372; bh=9VKuTLccy4nTACz5PglUQZIx0WyJQZU3myUXLu3A8NU=; h=From:To:Subject:Date:From; b=a+43MnDSKOzzKzDxgDUSzub3nL93AWa1YtexZMBu7ZwX+4OveOn5yydr9vWZxutp6 Sf0rZrdEujpLwslF0+TxBs49a3lkg4JPIe0k+jlrDxV7sO2c9OkJZXwKK2H/+7GM/P Z9f4UUL2iMHSWJkGE9/z7UDzgW4thKUE8WnMs/PM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Carlos O'Donell To: glibc-cvs@sourceware.org Subject: [glibc] elf: Fix tst-nodeps2 test failure. X-Act-Checkin: glibc X-Git-Author: Carlos O'Donell X-Git-Refname: refs/heads/master X-Git-Oldrev: a09b2aacd9a23969aa3d768a22fe491e1ee98cf3 X-Git-Newrev: 94aa256a47253d2202240c8696cbe824a969d3cc Message-Id: <20240110211612.149353858D38@sourceware.org> Date: Wed, 10 Jan 2024 21:16:11 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=94aa256a47253d2202240c8696cbe824a969d3cc commit 94aa256a47253d2202240c8696cbe824a969d3cc Author: Carlos O'Donell Date: Wed Jan 10 10:46:03 2024 -0500 elf: Fix tst-nodeps2 test failure. After 78ca44da0160a0b442f0ca1f253e3360f044b2ec ("elf: Relocate libc.so early during startup and dlmopen (bug 31083)") we start seeing tst-nodeps2 failures when building the testsuite with --enable-hard-coded-path-in-tests. When building the testsuite with --enable-hard-coded-path-in-tests the tst-nodeps2-mod.so is not built with the required DT_RUNPATH values and the test escapes the test framework and loads the system libraries and aborts. The fix is to use the existing $(link-test-modules-rpath-link) variable to set DT_RUNPATH correctly. No regressions on x86_64. Reviewed-by: Florian Weimer Diff: --- elf/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/elf/Makefile b/elf/Makefile index 600812e573..5d78b659ce 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -3022,6 +3022,8 @@ $(objpfx)tst-env-setuid: $(objpfx)tst-sonamemove-runmod2.so $(objpfx)tst-env-setuid-static.out: $(objpfx)tst-sonamemove-runmod1.so # The object tst-nodeps1-mod.so has no explicit dependencies on libc.so. +# We do not use $(link-test-modules-rpath-link) since the object has no +# DT_NEEDED. $(objpfx)tst-nodeps1-mod.so: $(objpfx)tst-nodeps1-mod.os $(LINK.o) -nostartfiles -nostdlib -shared -o $@ $^ tst-nodeps1.so-no-z-defs = yes @@ -3032,7 +3034,8 @@ $(objpfx)tst-nodeps1: $(objpfx)tst-nodeps1-mod.so # with the IFUNC resolver reference. $(objpfx)tst-nodeps2-mod.so: $(common-objpfx)libc.so \ $(objpfx)tst-nodeps1-mod.so $(objpfx)tst-nodeps2-mod.os - $(LINK.o) -Wl,--no-as-needed -nostartfiles -nostdlib -shared -o $@ $^ + $(LINK.o) -Wl,--no-as-needed -nostartfiles -nostdlib -shared -o $@ $^ \ + $(link-test-modules-rpath-link) $(objpfx)tst-nodeps2.out: \ $(objpfx)tst-nodeps1-mod.so $(objpfx)tst-nodeps2-mod.so