[PATCH] tst-p_alignmod3.so: Disable GNU_RELRO segment

H.J. Lu hjl.tools@gmail.com
Wed Jan 26 21:41:00 GMT 2022


tst-p_alignmod3.so has invalid p_align on LOAD segments which can't work
with GNU_RELRO.  Pass -z norelro to linker to disable GNU_RELRO segment
to trigger

.../elf/tst-p_alignmod3.so: ELF load command address/offset not page-aligned

instead of

.../elf/tst-p_alignmod3.so: cannot change memory protections
---
 elf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elf/Makefile b/elf/Makefile
index daafb5cf12..6229add1fc 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -2619,7 +2619,7 @@ $(objpfx)tst-p_alignmod2.so: $(objpfx)tst-p_alignmod-base.so
 	cp $(objpfx)tst-p_alignmod-base.so $@
 	$(PYTHON) $(..)scripts/tst-elf-edit.py -a 1 $@
 
-LDFLAGS-tst-p_alignmod3.so += -Wl,-z,max-page-size=0x100,-z,common-page-size=0x100
+LDFLAGS-tst-p_alignmod3.so += -Wl,-z,max-page-size=0x100,-z,common-page-size=0x100,-z,norelro
 
 $(objpfx)tst-p_align3: $(objpfx)tst-p_alignmod3.so
 $(objpfx)tst-p_align3.out: tst-p_align3.sh $(objpfx)tst-p_align3
-- 
2.34.1



More information about the Libc-alpha mailing list