* [PATCH 1/2] nptl: Rename tst-execstack to tst-execstack-threads
@ 2023-11-13 17:21 Florian Weimer
2023-11-13 17:21 ` [PATCH 2/2] nptl: Link tst-execstack-threads-mod.so with -z execstack Florian Weimer
2023-11-14 19:57 ` [PATCH 1/2] nptl: Rename tst-execstack to tst-execstack-threads Adhemerval Zanella Netto
0 siblings, 2 replies; 4+ messages in thread
From: Florian Weimer @ 2023-11-13 17:21 UTC (permalink / raw)
To: libc-alpha
So that the test is harder to confuse with elf/tst-execstack
(although the tests are supposed to be the same).
---
elf/tst-execstack.c | 7 ++++++-
nptl/Makefile | 10 +++++-----
...tst-execstack-mod.c => tst-execstack-threads-mod.c} | 0
nptl/{tst-execstack.c => tst-execstack-threads.c} | 0
4 files changed, 11 insertions(+), 6 deletions(-)
rename nptl/{tst-execstack-mod.c => tst-execstack-threads-mod.c} (100%)
rename nptl/{tst-execstack.c => tst-execstack-threads.c} (100%)
diff --git a/elf/tst-execstack.c b/elf/tst-execstack.c
index 7e898b4f58..560b353918 100644
--- a/elf/tst-execstack.c
+++ b/elf/tst-execstack.c
@@ -137,7 +137,12 @@ do_test (void)
#endif
/* Loading this module should force stacks to become executable. */
- void *h = dlopen ("tst-execstack-mod.so", RTLD_LAZY);
+#if USE_PTHREADS
+ const char *soname = "tst-execstack-threads-mod.so";
+#else
+ const char *soname = "tst-execstack-mod.so";
+#endif
+ void *h = dlopen (soname, RTLD_LAZY);
if (h == NULL)
{
printf ("cannot load: %s\n", dlerror ());
diff --git a/nptl/Makefile b/nptl/Makefile
index d969419af7..015295e45c 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -466,7 +466,7 @@ tests-internal += \
tst-tls5 \
# tests-internal
ifeq ($(have-z-execstack),yes)
-tests += tst-execstack
+tests += tst-execstack-threads
endif
endif
@@ -474,7 +474,7 @@ modules-names = \
tst-audit-threads-mod1 \
tst-audit-threads-mod2 \
tst-compat-forwarder-mod \
- tst-execstack-mod \
+ tst-execstack-threads-mod \
tst-stack4mod \
tst-tls3mod \
tst-tls5mod \
@@ -669,9 +669,9 @@ endif
tst-exec4-ARGS = $(host-test-program-cmd)
-$(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
-LDFLAGS-tst-execstack = -Wl,-z,noexecstack
-CFLAGS-tst-execstack-mod.c += -Wno-trampolines
+$(objpfx)tst-execstack-threads.out: $(objpfx)tst-execstack-threads-mod.so
+LDFLAGS-tst-execstack-threads = -Wl,-z,noexecstack
+CFLAGS-tst-execstack-threads-mod.c += -Wno-trampolines
tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child"
tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
diff --git a/nptl/tst-execstack-mod.c b/nptl/tst-execstack-threads-mod.c
similarity index 100%
rename from nptl/tst-execstack-mod.c
rename to nptl/tst-execstack-threads-mod.c
diff --git a/nptl/tst-execstack.c b/nptl/tst-execstack-threads.c
similarity index 100%
rename from nptl/tst-execstack.c
rename to nptl/tst-execstack-threads.c
base-commit: 2d27dc1c750849f888b38fa7f0dadf6b376095de
--
2.41.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] nptl: Link tst-execstack-threads-mod.so with -z execstack
2023-11-13 17:21 [PATCH 1/2] nptl: Rename tst-execstack to tst-execstack-threads Florian Weimer
@ 2023-11-13 17:21 ` Florian Weimer
2023-11-14 19:57 ` Adhemerval Zanella Netto
2023-11-14 19:57 ` [PATCH 1/2] nptl: Rename tst-execstack to tst-execstack-threads Adhemerval Zanella Netto
1 sibling, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2023-11-13 17:21 UTC (permalink / raw)
To: libc-alpha
This ensures that the test still links with a linker that refuses
to create an executable stack marker automatically.
---
nptl/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/nptl/Makefile b/nptl/Makefile
index 015295e45c..067b01ea8e 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -671,6 +671,7 @@ tst-exec4-ARGS = $(host-test-program-cmd)
$(objpfx)tst-execstack-threads.out: $(objpfx)tst-execstack-threads-mod.so
LDFLAGS-tst-execstack-threads = -Wl,-z,noexecstack
+LDFLAGS-tst-execstack-threads-mod.so = -Wl,-z,execstack
CFLAGS-tst-execstack-threads-mod.c += -Wno-trampolines
tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child"
--
2.41.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] nptl: Rename tst-execstack to tst-execstack-threads
2023-11-13 17:21 [PATCH 1/2] nptl: Rename tst-execstack to tst-execstack-threads Florian Weimer
2023-11-13 17:21 ` [PATCH 2/2] nptl: Link tst-execstack-threads-mod.so with -z execstack Florian Weimer
@ 2023-11-14 19:57 ` Adhemerval Zanella Netto
1 sibling, 0 replies; 4+ messages in thread
From: Adhemerval Zanella Netto @ 2023-11-14 19:57 UTC (permalink / raw)
To: Florian Weimer, libc-alpha
On 13/11/23 14:21, Florian Weimer wrote:
> So that the test is harder to confuse with elf/tst-execstack
> (although the tests are supposed to be the same).
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> elf/tst-execstack.c | 7 ++++++-
> nptl/Makefile | 10 +++++-----
> ...tst-execstack-mod.c => tst-execstack-threads-mod.c} | 0
> nptl/{tst-execstack.c => tst-execstack-threads.c} | 0
> 4 files changed, 11 insertions(+), 6 deletions(-)
> rename nptl/{tst-execstack-mod.c => tst-execstack-threads-mod.c} (100%)
> rename nptl/{tst-execstack.c => tst-execstack-threads.c} (100%)
>
> diff --git a/elf/tst-execstack.c b/elf/tst-execstack.c
> index 7e898b4f58..560b353918 100644
> --- a/elf/tst-execstack.c
> +++ b/elf/tst-execstack.c
> @@ -137,7 +137,12 @@ do_test (void)
> #endif
>
> /* Loading this module should force stacks to become executable. */
> - void *h = dlopen ("tst-execstack-mod.so", RTLD_LAZY);
> +#if USE_PTHREADS
> + const char *soname = "tst-execstack-threads-mod.so";
> +#else
> + const char *soname = "tst-execstack-mod.so";
> +#endif
> + void *h = dlopen (soname, RTLD_LAZY);
> if (h == NULL)
> {
> printf ("cannot load: %s\n", dlerror ());
> diff --git a/nptl/Makefile b/nptl/Makefile
> index d969419af7..015295e45c 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -466,7 +466,7 @@ tests-internal += \
> tst-tls5 \
> # tests-internal
> ifeq ($(have-z-execstack),yes)
> -tests += tst-execstack
> +tests += tst-execstack-threads
> endif
> endif
>
> @@ -474,7 +474,7 @@ modules-names = \
> tst-audit-threads-mod1 \
> tst-audit-threads-mod2 \
> tst-compat-forwarder-mod \
> - tst-execstack-mod \
> + tst-execstack-threads-mod \
> tst-stack4mod \
> tst-tls3mod \
> tst-tls5mod \
> @@ -669,9 +669,9 @@ endif
>
> tst-exec4-ARGS = $(host-test-program-cmd)
>
> -$(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
> -LDFLAGS-tst-execstack = -Wl,-z,noexecstack
> -CFLAGS-tst-execstack-mod.c += -Wno-trampolines
> +$(objpfx)tst-execstack-threads.out: $(objpfx)tst-execstack-threads-mod.so
> +LDFLAGS-tst-execstack-threads = -Wl,-z,noexecstack
> +CFLAGS-tst-execstack-threads-mod.c += -Wno-trampolines
>
> tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child"
> tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
> diff --git a/nptl/tst-execstack-mod.c b/nptl/tst-execstack-threads-mod.c
> similarity index 100%
> rename from nptl/tst-execstack-mod.c
> rename to nptl/tst-execstack-threads-mod.c
> diff --git a/nptl/tst-execstack.c b/nptl/tst-execstack-threads.c
> similarity index 100%
> rename from nptl/tst-execstack.c
> rename to nptl/tst-execstack-threads.c
>
> base-commit: 2d27dc1c750849f888b38fa7f0dadf6b376095de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] nptl: Link tst-execstack-threads-mod.so with -z execstack
2023-11-13 17:21 ` [PATCH 2/2] nptl: Link tst-execstack-threads-mod.so with -z execstack Florian Weimer
@ 2023-11-14 19:57 ` Adhemerval Zanella Netto
0 siblings, 0 replies; 4+ messages in thread
From: Adhemerval Zanella Netto @ 2023-11-14 19:57 UTC (permalink / raw)
To: Florian Weimer, libc-alpha
On 13/11/23 14:21, Florian Weimer wrote:
> This ensures that the test still links with a linker that refuses
> to create an executable stack marker automatically.
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> nptl/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/nptl/Makefile b/nptl/Makefile
> index 015295e45c..067b01ea8e 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -671,6 +671,7 @@ tst-exec4-ARGS = $(host-test-program-cmd)
>
> $(objpfx)tst-execstack-threads.out: $(objpfx)tst-execstack-threads-mod.so
> LDFLAGS-tst-execstack-threads = -Wl,-z,noexecstack
> +LDFLAGS-tst-execstack-threads-mod.so = -Wl,-z,execstack
> CFLAGS-tst-execstack-threads-mod.c += -Wno-trampolines
>
> tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child"
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-14 19:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-13 17:21 [PATCH 1/2] nptl: Rename tst-execstack to tst-execstack-threads Florian Weimer
2023-11-13 17:21 ` [PATCH 2/2] nptl: Link tst-execstack-threads-mod.so with -z execstack Florian Weimer
2023-11-14 19:57 ` Adhemerval Zanella Netto
2023-11-14 19:57 ` [PATCH 1/2] nptl: Rename tst-execstack to tst-execstack-threads Adhemerval Zanella Netto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).