Pass the correct ELFOSABI enumeration to the MipsELFObjectWriter constructor
authorJack Carter <jcarter@mips.com>
Mon, 2 Jul 2012 20:04:43 +0000 (20:04 +0000)
committerJack Carter <jcarter@mips.com>
Mon, 2 Jul 2012 20:04:43 +0000 (20:04 +0000)
Contributer: Sasa Stankovic

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159574 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
test/MC/Mips/elf_basic.s

index 684dc8f7987b1aba1f01fa19d676d1825397624b..d92c45d51dfc2ff4b092902676d3554c5bba375b 100644 (file)
@@ -78,7 +78,8 @@ public:
     :MCAsmBackend(), OSType(_OSType), IsLittle(_isLittle), Is64Bit(_is64Bit) {}
 
   MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
-    return createMipsELFObjectWriter(OS, OSType, IsLittle, Is64Bit);
+    return createMipsELFObjectWriter(OS,
+      MCELFObjectTargetWriter::getOSABI(OSType), IsLittle, Is64Bit);
   }
 
   /// ApplyFixup - Apply the \arg Value for given \arg Fixup into the provided
index 7a79fa066be48770e6b783f8b41e2c456409b7f7..ffc3b112e502dcc9970e1f6c9b4a6c964070c755 100644 (file)
@@ -30,3 +30,6 @@
 // CHECK-LE64: ('e_indent[EI_CLASS]', 0x02)
 // This is little endian.
 // CHECK-LE64: ('e_indent[EI_DATA]', 0x01)
+
+// Check that we are setting EI_OSABI to ELFOSABI_LINUX.
+// CHECK-LE64: ('e_indent[EI_OSABI]', 0x03)