aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2025-07-24 10:53:35 -0400
committerJohn David Anglin <danglin@gcc.gnu.org>2025-07-24 10:53:35 -0400
commitd21c8ba4795044ae863e832d0683ba10fec01c7c (patch)
tree9c8c2176edab055f3f80bf91c29d83dd60f29cb9
parent3ff17af18c38727b88d9115e536c069e6b5d601f (diff)
downloadglibc-d21c8ba4795044ae863e832d0683ba10fec01c7c.zip
glibc-d21c8ba4795044ae863e832d0683ba10fec01c7c.tar.gz
glibc-d21c8ba4795044ae863e832d0683ba10fec01c7c.tar.bz2
debug: Link tst-sprintf-fortify-rdonly-static with -Wl,-z,relro [BZ 33183]
This test requires relro_format be placed in the PT_GNU_RELRO segment. The ELF linker enables -z relro support by default on all Linux targets except FRV, HPPA, IA64 and MIPS. On these targets, we need to explicitly link with -z relro to place relro_format in the PT_GNU_RELRO segment. Signed-off-by: John David Anglin <dave.anglin@bell.net>
-rw-r--r--debug/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/debug/Makefile b/debug/Makefile
index 919bf91..6c857a5 100644
--- a/debug/Makefile
+++ b/debug/Makefile
@@ -187,6 +187,7 @@ CFLAGS-tst-sprintf-fortify-rdonly-dlopen.c += $(no-fortify-source) -D_FORTIFY_SO
CFLAGS-tst-sprintf-fortify-rdonly-static.c += $(no-fortify-source) -D_FORTIFY_SOURCE=2
CFLAGS-tst-fortify-syslog.c += $(no-fortify-source) -D_FORTIFY_SOURCE=2
CFLAGS-tst-fortify-wide.c += $(no-fortify-source) -D_FORTIFY_SOURCE=2
+LDFLAGS-tst-sprintf-fortify-rdonly-static += $(relro-LDFLAGS)
$(objpfx)tst-sprintf-fortify-rdonly: $(objpfx)tst-sprintf-fortify-rdonly-mod.so
$(objpfx)tst-sprintf-fortify-rdonly.out: \