[llvm-commits] [llvm] r111259 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp
Benjamin Kramer
benny.kra at googlemail.com
Tue Aug 17 10:56:13 PDT 2010
Author: d0k
Date: Tue Aug 17 12:56:13 2010
New Revision: 111259
URL: http://llvm.org/viewvc/llvm-project?rev=111259&view=rev
Log:
Use the correct entry size for relocation entries, 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=111259&r1=111258&r2=111259&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Aug 17 12:56:13 2010
@@ -748,9 +748,13 @@
const StringRef SectionName = Section.getSectionName();
std::string RelaSectionName = HasRelocationAddend ? ".rela" : ".rel";
-
RelaSectionName += SectionName;
- unsigned EntrySize = Is64Bit ? ELF::SYMENTRY_SIZE64 : ELF::SYMENTRY_SIZE32;
+
+ unsigned EntrySize;
+ if (HasRelocationAddend)
+ EntrySize = Is64Bit ? sizeof(ELF::Elf64_Rela) : sizeof(ELF::Elf32_Rela);
+ else
+ EntrySize = Is64Bit ? sizeof(ELF::Elf64_Rel) : sizeof(ELF::Elf32_Rel);
RelaSection = Ctx.getELFSection(RelaSectionName, HasRelocationAddend ?
ELF::SHT_RELA : ELF::SHT_REL, 0,
More information about the llvm-commits
mailing list