From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 2F2AB3858297; Wed, 7 Feb 2024 14:14:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F2AB3858297 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707315255; bh=/89TFCJS5sAaJyWf8aGYVL/E7lWngWWR3V2J36H3U2w=; h=From:To:Subject:Date:From; b=Vnb7st2Cze0BnJ/Tp3EjMSI+6nrZDrd12DksmOkU57uLeCsqNFNn0TnWuynyw5Yc7 ZCuXeB8pDbieFVH4nc7BaErqPOxaBtRZxLkkWnPe3EcWRN2v30FwoB5XQQXCzIc2ev K2A92XPnfuWcGGqrHW6pvf4iGg8A+qA6iFkxJXT4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] elf: Fix tests that require interposable symbols X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 0ac4c5dce2179d78280354bb6d921030e158bc46 X-Git-Newrev: 72ad590b4753e4fdb2cbef321a08e8155dc6c946 Message-Id: <20240207141415.2F2AB3858297@sourceware.org> Date: Wed, 7 Feb 2024 14:14:15 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=72ad590b4753e4fdb2cbef321a08e8155dc6c946 commit 72ad590b4753e4fdb2cbef321a08e8155dc6c946 Author: Adhemerval Zanella Date: Wed Jan 17 15:21:25 2024 -0300 elf: Fix tests that require interposable symbols clang defaults to -fsemantic-interposition, which in turn trigger some optimizations (like inline) that makes some tests that rely on ELF symbol interposition to fail. For this case, explicit set the symbol as weak to avoid it. Diff: --- elf/tst-dlclose-lazy-mod2.c | 1 + elf/tst-piemod1.c | 1 + 2 files changed, 2 insertions(+) diff --git a/elf/tst-dlclose-lazy-mod2.c b/elf/tst-dlclose-lazy-mod2.c index d1ae34330c..544803ca3e 100644 --- a/elf/tst-dlclose-lazy-mod2.c +++ b/elf/tst-dlclose-lazy-mod2.c @@ -20,6 +20,7 @@ #include void +__attribute__ ((weak)) exported_function (int ignored) { /* This function is interposed from tst-dlclose-lazy-mod1.so and diff --git a/elf/tst-piemod1.c b/elf/tst-piemod1.c index 72d7e0a187..225c057ea3 100644 --- a/elf/tst-piemod1.c +++ b/elf/tst-piemod1.c @@ -1,6 +1,7 @@ #include int +__attribute__((weak)) foo (void) { return 21;