Remove unused elf_machdep.h cruft.
Also add a few missing include guards.
Bug: N/A
Test: builds
Change-Id: I9557303c81a4b11d430112528def038ecb5562a9
diff --git a/libc/arch-arm/include/machine/elf_machdep.h b/libc/arch-arm/include/machine/elf_machdep.h
index 3496b28..f7ee43f 100644
--- a/libc/arch-arm/include/machine/elf_machdep.h
+++ b/libc/arch-arm/include/machine/elf_machdep.h
@@ -3,12 +3,6 @@
#ifndef _ARM_ELF_MACHDEP_H_
#define _ARM_ELF_MACHDEP_H_
-#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
-
-#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */
-#define ELF64_MACHDEP_ID_CASES \
- /* no 64-bit ELF machine types supported */
-
/* Processor specific flags for the ELF header e_flags field. */
#define EF_ARM_RELEXEC 0x00000001
#define EF_ARM_HASENTRY 0x00000002
@@ -30,14 +24,6 @@
#define EF_ARM_EABI_VER4 0x04000000
#define EF_ARM_EABI_VER5 0x05000000
-#define ELF32_MACHDEP_ID_CASES \
- case EM_ARM: \
- break;
-
-#define ELF32_MACHDEP_ID EM_ARM
-
-#define ARCH_ELFSIZE 32 /* MD native binary size */
-
/* Processor specific relocation types */
#define R_ARM_NONE 0
diff --git a/libc/arch-arm64/include/machine/elf_machdep.h b/libc/arch-arm64/include/machine/elf_machdep.h
index 6eab313..9f10b99 100644
--- a/libc/arch-arm64/include/machine/elf_machdep.h
+++ b/libc/arch-arm64/include/machine/elf_machdep.h
@@ -29,20 +29,6 @@
#ifndef _AARCH64_ELF_MACHDEP_H_
#define _AARCH64_ELF_MACHDEP_H_
-#if defined(__AARCH64EB__)
-#define ELF64_MACHDEP_ENDIANNESS ELFDATA2MSB
-#else
-#define ELF64_MACHDEP_ENDIANNESS ELFDATA2LSB
-#endif
-
-#define ELF64_MACHDEP_ID_CASES \
- case EM_AARCH64: \
- break;
-
-#define ELF64_MACHDEP_ID EM_AARCH64
-
-#define ARCH_ELFSIZE 64 /* MD native binary size */
-
/* Null relocations */
#define R_ARM_NONE 0
#define R_AARCH64_NONE 256
diff --git a/libc/arch-mips/include/machine/elf_machdep.h b/libc/arch-mips/include/machine/elf_machdep.h
index b6117f2..59e0974 100644
--- a/libc/arch-mips/include/machine/elf_machdep.h
+++ b/libc/arch-mips/include/machine/elf_machdep.h
@@ -3,26 +3,6 @@
#ifndef _MIPS_ELF_MACHDEP_H_
#define _MIPS_ELF_MACHDEP_H_
-#ifdef _LP64
-#define ARCH_ELFSIZE 64 /* MD native binary size */
-#else
-#define ARCH_ELFSIZE 32 /* MD native binary size */
-#endif
-
-#if ELFSIZE == 32
-#define ELF32_MACHDEP_ID_CASES \
- case EM_MIPS: \
- break;
-
-#define ELF32_MACHDEP_ID EM_MIPS
-#elif ELFSIZE == 64
-#define ELF64_MACHDEP_ID_CASES \
- case EM_MIPS: \
- break;
-
-#define ELF64_MACHDEP_ID EM_MIPS
-#endif
-
/* mips relocs. */
#define R_MIPS_NONE 0
@@ -151,7 +131,4 @@
#define EF_MIPS_ABI_EABI32 0x00003000
#define EF_MIPS_ABI_EABI64 0x00004000
-#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
-#define ELF64_MACHDEP_ENDIANNESS ELFDATA2LSB
-
#endif /* _MIPS_ELF_MACHDEP_H_ */
diff --git a/libc/arch-x86/include/machine/elf_machdep.h b/libc/arch-x86/include/machine/elf_machdep.h
index 4bce933..5324ebc 100644
--- a/libc/arch-x86/include/machine/elf_machdep.h
+++ b/libc/arch-x86/include/machine/elf_machdep.h
@@ -1,18 +1,7 @@
/* $NetBSD: elf_machdep.h,v 1.10 2009/05/30 05:56:52 skrll Exp $ */
-#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
-#define ELF32_MACHDEP_ID_CASES \
- case EM_386: \
- case EM_486: \
- break;
-
-#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */
-#define ELF64_MACHDEP_ID_CASES \
- /* no 64-bit ELF machine types supported */
-
-#define ELF32_MACHDEP_ID EM_386
-
-#define ARCH_ELFSIZE 32 /* MD native binary size */
+#ifndef _X86_ELF_MACHDEP_H_
+#define _X86_ELF_MACHDEP_H_
/* i386 relocations */
#define R_386_NONE 0
@@ -62,3 +51,5 @@
#define R_386_IRELATIVE 42
#define R_TYPE(name) __CONCAT(R_386_,name)
+
+#endif
diff --git a/libc/arch-x86_64/include/machine/elf_machdep.h b/libc/arch-x86_64/include/machine/elf_machdep.h
index bf1f273..dedbd41 100644
--- a/libc/arch-x86_64/include/machine/elf_machdep.h
+++ b/libc/arch-x86_64/include/machine/elf_machdep.h
@@ -1,21 +1,7 @@
/* $NetBSD: elf_machdep.h,v 1.4 2010/03/18 08:28:33 cegger Exp $ */
-#if !defined __i386__
-
-#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
-#define ELF32_MACHDEP_ID_CASES \
- case EM_386: \
- break;
-
-#define ELF64_MACHDEP_ENDIANNESS ELFDATA2LSB
-#define ELF64_MACHDEP_ID_CASES \
- case EM_X86_64: \
- break;
-
-#define ELF32_MACHDEP_ID EM_386
-#define ELF64_MACHDEP_ID EM_X86_64
-
-#define ARCH_ELFSIZE 64 /* MD native binary size */
+#ifndef _X86_64_ELF_MACHDEP_H_
+#define _X86_64_ELF_MACHDEP_H_
/* x86-64 relocations */
@@ -50,8 +36,4 @@
#define R_TYPE(name) __CONCAT(R_X86_64_,name)
-#else /* !__i386__ */
-
-#include <i386/elf_machdep.h>
-
-#endif /* !__i386__ */
+#endif