0002-paxtest-page-alignment-ARM-and-NIOS2-arch.patch 1.4 KB

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