1From 70406ad5668a15fedce2ae1ed3bc4fad04d9f040 Mon Sep 17 00:00:00 2001 2From: Matt Weber <matthew.weber@rockwellcollins.com> 3Date: Wed, 5 Jul 2017 20:47:42 -0500 4Subject: [PATCH] paxtest: page alignment ARM and NIOS2 arch 5 6- Extended ARM range from ARMv6-v7 to also include anything below v7 7- Added NIOS2 arch to conditionally have smaller alignment 8 9Submitted Upstream to pageexec@freemail.hu. Also posted a 10bug to both (Hardened) Suse and Gentoo's bugtrackers. 11https://bugzilla.opensuse.org/show_bug.cgi?id=1047422 12https://bugs.gentoo.org/show_bug.cgi?id=623946 13 14Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> 15--- 16 paxtest.h | 12 ++++++++++-- 17 1 file changed, 10 insertions(+), 2 deletions(-) 18 19diff --git a/paxtest.h b/paxtest.h 20index 8623bfb..a230c1a 100644 21--- a/paxtest.h 22+++ b/paxtest.h 23@@ -5,13 +5,21 @@ 24 #include <unistd.h> 25 26 /* 27- * ARMv6 and ARMv7 do not like 64k alignment, 32k is ok 28+ * Earlier ARMv# through ARMv7 do not like 64k alignment, 32k is ok 29 */ 30-#if defined(__arm__) && __ARM_ARCH >= 6 && __ARM_ARCH <= 7 31+#if defined(__arm__) && __ARM_ARCH <= 7 32 #define PAGE_SIZE_MAX (32768) 33 #else 34 #define PAGE_SIZE_MAX 0x10000 /* 64k should cover most arches */ 35 #endif 36+ 37+/* 38+ * NIOS2's assemblier doesn't like 64k alignment 39+ */ 40+#if defined(__nios2_arch__) 41+#define PAGE_SIZE_MAX (32768) 42+#endif 43+ 44 #ifndef __aligned 45 #define __aligned(x) __attribute__((aligned(x))) 46 #endif 47-- 481.9.1 49 50