]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
debug: Link tst-sprintf-fortify-rdonly-static with -Wl,-z,relro [BZ 33183]
authorJohn David Anglin <danglin@gcc.gnu.org>
Thu, 24 Jul 2025 14:53:35 +0000 (10:53 -0400)
committerJohn David Anglin <danglin@gcc.gnu.org>
Thu, 24 Jul 2025 14:53:35 +0000 (10:53 -0400)
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>
debug/Makefile

index 919bf91c428db6fb51fd499fbcfb599364a2cc9e..6c857a56dab8b7bb21efb0701f7ac2c361e87d3e 100644 (file)
@@ -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: \