From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1039) id 75D193858D33; Wed, 25 Jan 2023 17:09:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75D193858D33 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: H.J. Lu To: bfd-cvs@sourceware.org Subject: [binutils-gdb] i386: Pass -Wl,--no-as-needed to compiler as needed X-Act-Checkin: binutils-gdb X-Git-Author: H.J. Lu X-Git-Refname: refs/heads/master X-Git-Oldrev: d8f5b7d1d1e8e1f0352848b7066dd133edd50773 X-Git-Newrev: 0e46a09d12aa9c2c77d783ace336866e429ffa73 Message-Id: <20230125170901.75D193858D33@sourceware.org> Date: Wed, 25 Jan 2023 17:09:01 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2023 17:09:01 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D0e46a09d12aa= 9c2c77d783ace336866e429ffa73 commit 0e46a09d12aa9c2c77d783ace336866e429ffa73 Author: H.J. Lu Date: Wed Jan 25 08:57:57 2023 -0800 i386: Pass -Wl,--no-as-needed to compiler as needed =20 Pass -Wl,--no-as-needed to linker tests to fix =20 FAIL: Run pr19031 FAIL: Run got1 FAIL: Undefined weak symbol (-fPIE -no-pie) FAIL: Undefined weak symbol (-fPIE -pie) =20 when --as-needed is passed to linker by compiler. =20 PR ld/30050 * testsuite/ld-i386/i386.exp: Pass -Wl,--no-as-needed to compil= er as needed. Diff: --- ld/testsuite/ld-i386/i386.exp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index 89e8aee237c..5f53bcf29bc 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -577,7 +577,8 @@ proc undefined_weak {cflags ldflags} { run_ld_link_exec_tests [list \ [list \ "Run pr19704" \ - "$ldflags tmpdir/libpr19704.so -Wl,-R,tmpdir" \ + "$ldflags -Wl,--no-as-needed tmpdir/libpr19704.so \ + -Wl,-R,tmpdir" \ "-Wa,-mrelax-relocations=3Dyes" \ { pr19704a.c } \ "pr19704" \ @@ -1078,7 +1079,7 @@ if { [isnative] ] \ [list \ "Run pr19031" \ - "$NOPIE_LDFLAGS tmpdir/pr19031.so" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr19031.so" \ "-Wa,-mx86-used-note=3Dyes" \ { pr19031b.S pr19031c.c } \ "pr19031" \ @@ -1087,7 +1088,7 @@ if { [isnative] ] \ [list \ "Run got1" \ - "$NOPIE_LDFLAGS tmpdir/got1d.so" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/got1d.so" \ "-Wa,-mx86-used-note=3Dyes" \ { got1a.S got1b.c got1c.c } \ "got1" \