From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1039) id 1D1B53882769; Mon, 31 Oct 2022 16:01:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D1B53882769 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667232064; bh=2IzI3w54pg8e4800YMBnP1gMm+E/BtKuKL0Qhbj8txE=; h=From:To:Subject:Date:From; b=EP4eK11X+jE81+1h6Sl09Ug2Nxfslo0kYgsU50hwM5I5vakCSsir6zsEucfZ8JgmH 5m/YZjjNvWWqPEGwW81pOqpniLcNxxGxJwUqgxWolQzXEwJJ6V8GE/x5FCZKezxvWl bTu7FAJwKUAvShcsPtijXWvYhjOrxuAZjN7gsRwY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: H.J. Lu To: glibc-cvs@sourceware.org Subject: [glibc] elf: Build tst-relr-mod[34]a.so with $(LDFLAGS-rpath-ORIGIN) X-Act-Checkin: glibc X-Git-Author: H.J. Lu X-Git-Refname: refs/heads/master X-Git-Oldrev: e96971482de05eff92c1408b694c320cedd2d167 X-Git-Newrev: bbff275fb1b16f5b7dd95933bde6e1e496414dbf Message-Id: <20221031160104.1D1B53882769@sourceware.org> Date: Mon, 31 Oct 2022 16:01:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bbff275fb1b16f5b7dd95933bde6e1e496414dbf commit bbff275fb1b16f5b7dd95933bde6e1e496414dbf Author: H.J. Lu Date: Fri Oct 28 15:16:32 2022 -0700 elf: Build tst-relr-mod[34]a.so with $(LDFLAGS-rpath-ORIGIN) When --enable-hardcoded-path-in-tests is used only with DT_RUNPATH, elf/tst-relr3 and elf/tst-relr4 failed to run. Their dependency libraries, tst-relr-mod3a.so and tst-relr-mod4a.so, are failed to load since DT_RUNPATH on executable doesn't apply to them. Build tst-relr-mod3a.so and tst-relr-mod4a.so with $(LDFLAGS-rpath-ORIGIN) to add DT_RUNPATH for their dependency libraries. Reviewed-by: Fangrui Song Diff: --- elf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index 86c960cf8a..5f7d222bb1 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -2872,7 +2872,7 @@ $(objpfx)tst-relr-mod3b.so: $(objpfx)tst-relr-mod3b.os $(objpfx)tst-relr-mod3a.so: $(objpfx)tst-relr-mod3a.os \ $(objpfx)tst-relr-mod3b.so $(LINK.o) -nostdlib -nostartfiles -Wl,-z,pack-relative-relocs \ - $(LDFLAGS-soname-fname) \ + $(LDFLAGS-soname-fname) $(LDFLAGS-rpath-ORIGIN) \ -shared -o $@.new $(filter-out $(map-file),$^) $(call after-link,$@.new) mv -f $@.new $@ @@ -2891,7 +2891,7 @@ $(objpfx)tst-relr-mod4b.so: $(objpfx)tst-relr-mod4b.os $(objpfx)tst-relr-mod4a.so: $(objpfx)tst-relr-mod4a.os \ $(objpfx)tst-relr-mod4b.so $(LINK.o) -nostdlib -nostartfiles -Wl,-z,pack-relative-relocs \ - $(LDFLAGS-soname-fname) \ + $(LDFLAGS-soname-fname) $(LDFLAGS-rpath-ORIGIN) \ -shared -o $@.new $(filter-out $(map-file),$^) $(call after-link,$@.new) mv -f $@.new $@