public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Cc: "H . J . Lu" <hjl.tools@gmail.com>,
	Florian Weimer <fweimer@redhat.com>,
	Zack Weinberg <zack@owlfolio.org>
Subject: [PATCH v3 3/4] elf: Add tst-execstack-prog-static
Date: Tue, 18 Jun 2024 16:40:21 -0300	[thread overview]
Message-ID: <20240618194102.2059389-4-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20240618194102.2059389-1-adhemerval.zanella@linaro.org>

Similar to tst-execstack-prog, check if executable stacks works for
statically linked programs.
---
 elf/Makefile                    | 7 +++++++
 elf/tst-execstack-prog-static.c | 1 +
 2 files changed, 8 insertions(+)
 create mode 100644 elf/tst-execstack-prog-static.c

diff --git a/elf/Makefile b/elf/Makefile
index bb6cd06dec..604b7df1cc 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -543,6 +543,9 @@ tests-execstack-yes = \
   tst-execstack-needed \
   tst-execstack-prog \
   # tests-execstack-yes
+tests-execstack-static-yes = \
+  tst-execstack-prog-static
+  # tests-execstack-static-yes
 endif
 ifeq ($(have-depaudit),yes)
 tests += \
@@ -630,6 +633,7 @@ $(objpfx)tst-rtld-does-not-exist.out: tst-rtld-does-not-exist.sh $(objpfx)ld.so
 	$(evaluate-test)
 
 tests += $(tests-execstack-$(have-z-execstack))
+tests-static+= $(tests-execstack-static-$(have-z-execstack))
 ifeq ($(run-built-tests),yes)
 tests-special += \
   $(objpfx)noload-mem.out \
@@ -1856,6 +1860,9 @@ LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack
 LDFLAGS-tst-execstack-prog = -Wl,-z,execstack
 CFLAGS-tst-execstack-prog.c += -Wno-trampolines
 CFLAGS-tst-execstack-mod.c += -Wno-trampolines
+
+LDFLAGS-tst-execstack-prog-static = -Wl,-z,execstack
+CFLAGS-tst-execstack-prog-static.c += -Wno-trampolines
 endif
 
 LDFLAGS-tst-array2 = -Wl,--no-as-needed
diff --git a/elf/tst-execstack-prog-static.c b/elf/tst-execstack-prog-static.c
new file mode 100644
index 0000000000..328065dd9c
--- /dev/null
+++ b/elf/tst-execstack-prog-static.c
@@ -0,0 +1 @@
+#include <tst-execstack-prog.c>
-- 
2.43.0


  parent reply	other threads:[~2024-06-18 19:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18 19:40 [PATCH v3 0/4] Improve executable stack handling Adhemerval Zanella
2024-06-18 19:40 ` [PATCH v3 1/4] elf: Consolidate stackinfo.h Adhemerval Zanella
2024-06-18 19:40 ` [PATCH v3 2/4] elf: Do not change stack permission on dlopen/dlmopen Adhemerval Zanella
2024-06-18 19:40 ` Adhemerval Zanella [this message]
2024-06-18 19:40 ` [PATCH v3 4/4] elf: Add glibc.rtld.execstack Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240618194102.2059389-4-adhemerval.zanella@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=zack@owlfolio.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).