aboutsummaryrefslogtreecommitdiff
path: root/elf/Makefile
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-12-21 13:42:28 -0800
committerH.J. Lu <hjl.tools@gmail.com>2022-01-24 06:37:36 -0800
commitd8d94863ef125a392b929732b37e07dc927fbcd1 (patch)
tree24b3c5add86c3bc0eb2afeb9f9fc401d87bf252f /elf/Makefile
parente4c9268d154ff11c070eba4791d33bd3a5875bca (diff)
downloadglibc-d8d94863ef125a392b929732b37e07dc927fbcd1.tar
glibc-d8d94863ef125a392b929732b37e07dc927fbcd1.tar.gz
glibc-d8d94863ef125a392b929732b37e07dc927fbcd1.tar.bz2
glibc-d8d94863ef125a392b929732b37e07dc927fbcd1.zip
elf: Add a test for PT_LOAD segments with invalid p_align [BZ #28688]
Build tst-p_alignmod3.so with 256 byte page size and verify that it is rejected with a proper error message. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'elf/Makefile')
-rw-r--r--elf/Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 687b913a53..41e0f2e8c4 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -417,6 +417,7 @@ tests += \
tst-p_alignmod2-edit \
tst-p_align1 \
tst-p_align2 \
+ tst-p_align3 \
tst-relsort1 \
tst-ro-dynamic \
tst-rtld-run-static \
@@ -742,6 +743,7 @@ modules-names = \
tst-nodelete-opened-lib \
tst-null-argv-lib \
tst-p_alignmod-base \
+ tst-p_alignmod3 \
tst-relsort1mod1 \
tst-relsort1mod2 \
tst-ro-dynamic-mod \
@@ -2622,3 +2624,10 @@ $(objpfx)tst-p_alignmod2.so: $(objpfx)tst-p_alignmod2-edit \
cp $(objpfx)tst-p_alignmod-base.so $@
$(test-wrapper-env) $(run-program-env) $(rtld-prefix) \
$(objpfx)tst-p_alignmod2-edit $@
+
+LDFLAGS-tst-p_alignmod3.so += -Wl,-z,max-page-size=0x100,-z,common-page-size=0x100
+
+$(objpfx)tst-p_align3: $(objpfx)tst-p_alignmod3.so
+$(objpfx)tst-p_align3.out: tst-p_align3.sh $(objpfx)tst-p_align3
+ $(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
+ $(evaluate-test)