Fix a bug in the ELF writer that caused it to produce malformed
authorDan Gohman <gohman@apple.com>
Mon, 5 May 2008 16:48:32 +0000 (16:48 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 5 May 2008 16:48:32 +0000 (16:48 +0000)
ELF headers. The ELF writer still isn't generally usable though.

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

lib/CodeGen/ELFWriter.cpp

index baba0551dd44838e939f940b8b303f75b4678474..63fee3a8d74dc871d177c5faf610431c85b50599 100644 (file)
@@ -229,7 +229,7 @@ bool ELFWriter::doInitialization(Module &M) {
 
   // This should change for shared objects.
   FHOut.outhalf(1);                 // e_type = ET_REL
-  FHOut.outword(TM.getELFWriterInfo()->getEMachine()); // target-defined
+  FHOut.outhalf(TM.getELFWriterInfo()->getEMachine()); // target-defined
   FHOut.outword(1);                 // e_version = 1
   FHOut.outaddr(0);                 // e_entry = 0 -> no entry point in .o file
   FHOut.outaddr(0);                 // e_phoff = 0 -> no program header for .o