summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2015-05-07 15:35:23 -0400
committerPaul Moore <pmoore@redhat.com>2015-05-07 15:35:23 -0400
commitf8de89b8764afa1e714e7b6d1c2247a655ed5470 (patch)
tree249215a79c073d473d7708e883f722f57d5d398f /tools
parent4367b1b4f94ca1e0c0606ff85622f2ecb1a9c278 (diff)
downloadlibseccomp-f8de89b8764afa1e714e7b6d1c2247a655ed5470.tar.gz
all: ensure the ARM and MIPS system defines are present
On some really old systems the ELF and or Audit ABI/arch defines are missing, this patch provides our own #defines in these cases. Reported-by: Vincent.Riera@imgtec.com Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/util.h34
1 files changed, 25 insertions, 9 deletions
diff --git a/tools/util.h b/tools/util.h
index 261320f..4ec3f91 100644
--- a/tools/util.h
+++ b/tools/util.h
@@ -26,27 +26,43 @@
#include <inttypes.h>
#include <linux/audit.h>
+/**
+ * The ARM architecture tokens
+ */
+/* AArch64 support for audit was merged in 3.17-rc1 */
+#ifndef AUDIT_ARCH_AARCH64
+#ifndef EM_AARCH64
+#define EM_AARCH64 183
+#endif /* EM_AARCH64 */
+#define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#endif /* AUDIT_ARCH_AARCH64 */
+
+/**
+ * The MIPS architecture tokens
+ */
#ifndef __AUDIT_ARCH_CONVENTION_MIPS64_N32
#define __AUDIT_ARCH_CONVENTION_MIPS64_N32 0x20000000
#endif
-
-#ifndef AUDIT_ARCH_MIPS64N32
+#ifndef EM_MIPS
+#define EM_MIPS 8
+#endif
+#ifndef AUDIT_ARCH_MIPS
+#define AUDIT_ARCH_MIPS (EM_MIPS)
+#endif
+#ifndef AUDIT_ARCH_MIPS64
+#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
+#endif
/* MIPS64N32 support was merged in 3.15 */
+#ifndef AUDIT_ARCH_MIPS64N32
#define AUDIT_ARCH_MIPS64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|\
__AUDIT_ARCH_CONVENTION_MIPS64_N32)
#endif
-
-#ifndef AUDIT_ARCH_MIPSEL64N32
/* MIPSEL64N32 support was merged in 3.15 */
+#ifndef AUDIT_ARCH_MIPSEL64N32
#define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\
__AUDIT_ARCH_CONVENTION_MIPS64_N32)
#endif
-#ifndef AUDIT_ARCH_AARCH64
-/* AArch64 support for audit was merged in 3.17-rc1 */
-#define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
-#endif
-
extern uint32_t arch;
void exit_usage(const char *program);