[llvm-commits] [llvm] r111247 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp
Benjamin Kramer
benny.kra at googlemail.com
Tue Aug 17 10:02:29 PDT 2010
Author: d0k
Date: Tue Aug 17 12:02:29 2010
New Revision: 111247
URL: http://llvm.org/viewvc/llvm-project?rev=111247&view=rev
Log:
One baby step towards i386 ELF, from Roman Divacky.
Modified:
llvm/trunk/lib/MC/ELFObjectWriter.cpp
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111247&r1=111246&r2=111247&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Aug 17 12:02:29 2010
@@ -316,12 +316,13 @@
Write16(ELF::ET_REL); // e_type
// FIXME: Make this configurable
- Write16(ELF::EM_X86_64); // e_machine = target
+ Write16(Is64Bit ? ELF::EM_X86_64 : ELF::EM_386); // e_machine = target
Write32(ELF::EV_CURRENT); // e_version
WriteWord(0); // e_entry, no entry point in .o file
WriteWord(0); // e_phoff, no program header for .o
- WriteWord(SectionDataSize + 64); // e_shoff = sec hdr table off in bytes
+ WriteWord(SectionDataSize + (Is64Bit ? sizeof(ELF::Elf64_Ehdr) :
+ sizeof(ELF::Elf32_Ehdr))); // e_shoff = sec hdr table off in bytes
// FIXME: Make this configurable.
Write32(0); // e_flags = whatever the target wants
More information about the llvm-commits
mailing list