[lld] r249956 - ELF2: Remove a variable to which always the same value is assigned.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 10 15:36:37 PDT 2015
Author: ruiu
Date: Sat Oct 10 17:36:36 2015
New Revision: 249956
URL: http://llvm.org/viewvc/llvm-project?rev=249956&view=rev
Log:
ELF2: Remove a variable to which always the same value is assigned.
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=249956&r1=249955&r2=249956&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Sat Oct 10 17:36:36 2015
@@ -86,7 +86,6 @@ private:
Elf_Phdr DynamicPhdr;
uintX_t FileSize;
- uintX_t ProgramHeaderOff;
uintX_t SectionHeaderOff;
};
} // anonymous namespace
@@ -466,7 +465,6 @@ template <class ELFT> void Writer<ELFT>:
phdrSet(&PhdrPhdr, PT_PHDR, PF_R, FileOff, VA, /*Align=*/8);
// Reserve space for Phdrs.
- ProgramHeaderOff = FileOff;
FileOff = RoundUpToAlignment(FileOff, Target->getPageSize());
VA = RoundUpToAlignment(VA, Target->getPageSize());
@@ -559,7 +557,7 @@ template <class ELFT> void Writer<ELFT>:
if (Config->EntrySym)
if (auto *E = dyn_cast<ELFSymbolBody<ELFT>>(Config->EntrySym->repl()))
EHdr->e_entry = getSymVA<ELFT>(*E);
- EHdr->e_phoff = ProgramHeaderOff;
+ EHdr->e_phoff = sizeof(Elf_Ehdr);
EHdr->e_shoff = SectionHeaderOff;
EHdr->e_ehsize = sizeof(Elf_Ehdr);
EHdr->e_phentsize = sizeof(Elf_Phdr);
More information about the llvm-commits
mailing list