From 5baf79edc067a4b17d024cc10324ac88c17e3e43 Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Thu, 9 Sep 2010 17:57:50 +0000 Subject: Make ELF OS ABI dependent on the OS from target triple. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113508 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86AsmBackend.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'lib/Target') diff --git a/lib/Target/X86/X86AsmBackend.cpp b/lib/Target/X86/X86AsmBackend.cpp index 69dc967f9d..4b51b69dc2 100644 --- a/lib/Target/X86/X86AsmBackend.cpp +++ b/lib/Target/X86/X86AsmBackend.cpp @@ -186,25 +186,27 @@ bool X86AsmBackend::WriteNopData(uint64_t Count, MCObjectWriter *OW) const { namespace { class ELFX86AsmBackend : public X86AsmBackend { public: - ELFX86AsmBackend(const Target &T) - : X86AsmBackend(T) { + Triple::OSType OSType; + ELFX86AsmBackend(const Target &T, Triple::OSType _OSType) + : X86AsmBackend(T), OSType(_OSType) { HasAbsolutizedSet = true; HasScatteredSymbols = true; } bool isVirtualSection(const MCSection &Section) const { const MCSectionELF &SE = static_cast(Section); - return SE.getType() == MCSectionELF::SHT_NOBITS;; + return SE.getType() == MCSectionELF::SHT_NOBITS; } }; class ELFX86_32AsmBackend : public ELFX86AsmBackend { public: - ELFX86_32AsmBackend(const Target &T) - : ELFX86AsmBackend(T) {} + ELFX86_32AsmBackend(const Target &T, Triple::OSType OSType) + : ELFX86AsmBackend(T, OSType) {} MCObjectWriter *createObjectWriter(raw_ostream &OS) const { return new ELFObjectWriter(OS, /*Is64Bit=*/false, + OSType, /*IsLittleEndian=*/true, /*HasRelocationAddend=*/false); } @@ -212,11 +214,12 @@ public: class ELFX86_64AsmBackend : public ELFX86AsmBackend { public: - ELFX86_64AsmBackend(const Target &T) - : ELFX86AsmBackend(T) {} + ELFX86_64AsmBackend(const Target &T, Triple::OSType OSType) + : ELFX86AsmBackend(T, OSType) {} MCObjectWriter *createObjectWriter(raw_ostream &OS) const { return new ELFObjectWriter(OS, /*Is64Bit=*/true, + OSType, /*IsLittleEndian=*/true, /*HasRelocationAddend=*/true); } @@ -324,7 +327,7 @@ TargetAsmBackend *llvm::createX86_32AsmBackend(const Target &T, case Triple::Win32: return new WindowsX86AsmBackend(T, false); default: - return new ELFX86_32AsmBackend(T); + return new ELFX86_32AsmBackend(T, Triple(TT).getOS()); } } @@ -338,6 +341,6 @@ TargetAsmBackend *llvm::createX86_64AsmBackend(const Target &T, case Triple::Win32: return new WindowsX86AsmBackend(T, true); default: - return new ELFX86_64AsmBackend(T); + return new ELFX86_64AsmBackend(T, Triple(TT).getOS()); } } -- cgit v1.2.3