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