[lld] r255631 - Reapply fixed r255626 that broke buildbot:
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 15 00:48:39 PST 2015
Author: grimar
Date: Tue Dec 15 02:48:39 2015
New Revision: 255631
URL: http://llvm.org/viewvc/llvm-project?rev=255631&view=rev
Log:
Reapply fixed r255626 that broke buildbot:
[ELF] - refactor of code in RelocationSection<ELFT>::writeTo()
Just a little reformat of 'if' conditions, NFC.
Differential revision: http://reviews.llvm.org/D15453
Fix was:
* Renamed unsigned Rel; to unsigned Reloc;
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=255631&r1=255630&r2=255631&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Dec 15 02:48:39 2015
@@ -264,21 +264,19 @@ template <class ELFT> void RelocationSec
bool LazyReloc = Body && Target->supportsLazyRelocations() &&
Target->relocNeedsPlt(Type, *Body);
- if (CanBePreempted) {
- unsigned GotReloc =
- Body->isTLS() ? Target->getTlsGotReloc() : Target->getGotReloc();
- if (NeedsGot)
- P->setSymbolAndType(Body->getDynamicSymbolTableIndex(),
- LazyReloc ? Target->getPltReloc() : GotReloc,
- Config->Mips64EL);
- else
- P->setSymbolAndType(Body->getDynamicSymbolTableIndex(),
- NeedsCopy ? Target->getCopyReloc()
- : Target->getDynReloc(Type),
- Config->Mips64EL);
- } else {
- P->setSymbolAndType(0, Target->getRelativeReloc(), Config->Mips64EL);
- }
+ unsigned Sym = CanBePreempted ? Body->getDynamicSymbolTableIndex() : 0;
+ unsigned Reloc;
+ if (!CanBePreempted)
+ Reloc = Target->getRelativeReloc();
+ else if (LazyReloc)
+ Reloc = Target->getPltReloc();
+ else if (NeedsGot)
+ Reloc = Body->isTLS() ? Target->getTlsGotReloc() : Target->getGotReloc();
+ else if (NeedsCopy)
+ Reloc = Target->getCopyReloc();
+ else
+ Reloc = Target->getDynReloc(Type);
+ P->setSymbolAndType(Sym, Reloc, Config->Mips64EL);
if (NeedsGot) {
if (LazyReloc)
More information about the llvm-commits
mailing list