diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-08-17 17:02:29 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-08-17 17:02:29 +0000 |
commit | eb97677764beb115c658ac559d3649c6c4068eb9 (patch) | |
tree | ce6815d7b0e7012ce0c044d15d0177fcb2416b48 /lib/MC/ELFObjectWriter.cpp | |
parent | 23e70ebf352ff4938210711464c68b5a6e46e61c (diff) |
One baby step towards i386 ELF, from Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111247 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/ELFObjectWriter.cpp')
-rw-r--r-- | lib/MC/ELFObjectWriter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index a5ecfc905a..610f685606 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -316,12 +316,13 @@ void ELFObjectWriterImpl::WriteHeader(uint64_t SectionDataSize, 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 |