Making the e_machine configurable by the target backend in ELFObjectWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117099 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMAsmBackend.cpp b/lib/Target/ARM/ARMAsmBackend.cpp
index d113cf5..72f6e2b 100644
--- a/lib/Target/ARM/ARMAsmBackend.cpp
+++ b/lib/Target/ARM/ARMAsmBackend.cpp
@@ -19,6 +19,7 @@
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MachObjectWriter.h"
+#include "llvm/Support/ELF.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetRegistry.h"
@@ -90,7 +91,7 @@
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
return new ELFObjectWriter(OS, /*Is64Bit=*/false,
- OSType,
+ OSType, ELF::EM_ARM,
/*IsLittleEndian=*/true,
/*HasRelocationAddend=*/false);
}
diff --git a/lib/Target/MBlaze/MBlazeAsmBackend.cpp b/lib/Target/MBlaze/MBlazeAsmBackend.cpp
index 7e11f73..05d9c90 100644
--- a/lib/Target/MBlaze/MBlazeAsmBackend.cpp
+++ b/lib/Target/MBlaze/MBlazeAsmBackend.cpp
@@ -19,6 +19,7 @@
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MachObjectWriter.h"
+#include "llvm/Support/ELF.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetRegistry.h"
@@ -104,7 +105,7 @@
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
return new ELFObjectWriter(OS, /*Is64Bit=*/false,
- OSType,
+ OSType, ELF::EM_MBLAZE,
/*IsLittleEndian=*/false,
/*HasRelocationAddend=*/true);
}
diff --git a/lib/Target/X86/X86AsmBackend.cpp b/lib/Target/X86/X86AsmBackend.cpp
index 83fca51..17db41a 100644
--- a/lib/Target/X86/X86AsmBackend.cpp
+++ b/lib/Target/X86/X86AsmBackend.cpp
@@ -20,6 +20,7 @@
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MachObjectWriter.h"
+#include "llvm/Support/ELF.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetRegistry.h"
@@ -228,7 +229,7 @@
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
return new ELFObjectWriter(OS, /*Is64Bit=*/false,
- OSType,
+ OSType, ELF::EM_386,
/*IsLittleEndian=*/true,
/*HasRelocationAddend=*/false);
}
@@ -245,7 +246,7 @@
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
return new ELFObjectWriter(OS, /*Is64Bit=*/true,
- OSType,
+ OSType, ELF::EM_X86_64,
/*IsLittleEndian=*/true,
/*HasRelocationAddend=*/true);
}