From: John David Anglin Date: Thu, 24 Jul 2025 14:53:35 +0000 (-0400) Subject: debug: Link tst-sprintf-fortify-rdonly-static with -Wl,-z,relro [BZ 33183] X-Git-Tag: glibc-2.42~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d21c8ba4795044ae863e832d0683ba10fec01c7c;p=thirdparty%2Fglibc.git 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 --- diff --git a/debug/Makefile b/debug/Makefile index 919bf91c42..6c857a56da 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: \