[lld] r265242 - Simplify. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 2 12:36:37 PDT 2016
Author: ruiu
Date: Sat Apr 2 14:36:36 2016
New Revision: 265242
URL: http://llvm.org/viewvc/llvm-project?rev=265242&view=rev
Log:
Simplify. NFC.
Modified:
lld/trunk/ELF/OutputSections.cpp
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=265242&r1=265241&r2=265242&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Sat Apr 2 14:36:36 2016
@@ -1430,21 +1430,18 @@ void SymbolTableSection<ELFT>::writeLoca
const Elf_Sym *Sym = P.first;
auto *ESym = reinterpret_cast<Elf_Sym *>(Buf);
- uintX_t VA = 0;
if (Sym->st_shndx == SHN_ABS) {
ESym->st_shndx = SHN_ABS;
- VA = Sym->st_value;
+ ESym->st_value = Sym->st_value;
} else {
InputSectionBase<ELFT> *Section = File->getSection(*Sym);
const OutputSectionBase<ELFT> *OutSec = Section->OutSec;
ESym->st_shndx = OutSec->SectionIndex;
- VA = Section->getOffset(*Sym);
- VA += OutSec->getVA();
+ ESym->st_value = OutSec->getVA() + Section->getOffset(*Sym);
}
ESym->st_name = P.second;
ESym->st_size = Sym->st_size;
ESym->setBindingAndType(Sym->getBinding(), Sym->getType());
- ESym->st_value = VA;
Buf += sizeof(*ESym);
}
}
More information about the llvm-commits
mailing list