aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-01-17 15:21:25 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-02-09 10:29:18 -0300
commit59c270c3e59a859ced1204d2be03510539a32925 (patch)
treee3d9186963b20d702451b274ac49737fd3ec34f0
parentf7d4a6676aaf39e53a1b7d12740806b68156f784 (diff)
downloadglibc-59c270c3e59a859ced1204d2be03510539a32925.tar
glibc-59c270c3e59a859ced1204d2be03510539a32925.tar.gz
glibc-59c270c3e59a859ced1204d2be03510539a32925.tar.bz2
glibc-59c270c3e59a859ced1204d2be03510539a32925.zip
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.
-rw-r--r--elf/tst-dlclose-lazy-mod2.c1
-rw-r--r--elf/tst-piemod1.c1
2 files changed, 2 insertions, 0 deletions
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 <stdlib.h>
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 <stdio.h>
int
+__attribute__((weak))
foo (void)
{
return 21;