diff options
| author | George Rimar <grimar@accesssoftek.com> | 2015-12-15 08:39:42 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2015-12-15 08:39:42 +0000 |
| commit | b076446368d17632e7e6e2fc952b98ba4dcb1718 (patch) | |
| tree | 9f61146ba9b9b3e946f43d1089086dfb2833d801 /lld | |
| parent | 009c5d52e3e2e713e5cf943bb1ba6d5050388a4e (diff) | |
| download | bcm5719-llvm-b076446368d17632e7e6e2fc952b98ba4dcb1718.tar.gz bcm5719-llvm-b076446368d17632e7e6e2fc952b98ba4dcb1718.zip | |
Revert of r255626 "[ELF] - refactor of code in RelocationSection<ELFT>::writeTo()"
as it broke buildbot:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/17836/steps/build_Lld/logs/stdio
/Users/buildslave/as-bldslv9/lld-x86_64-darwin13/llvm.src/tools/lld/ELF/OutputSections.cpp:268:14: error: redefinition of 'Rel'
unsigned Rel; ^
/Users/buildslave/as-bldslv9/lld-x86_64-darwin13/llvm.src/tools/lld/ELF/OutputSections.cpp:241:34: note: previous definition is here
for (const DynamicReloc<ELFT> &Rel : Relocs) {
That compiles fine on my MSVS 2015 thought.
llvm-svn: 255628
Diffstat (limited to 'lld')
| -rw-r--r-- | lld/ELF/OutputSections.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index d28df76b7a5..c64610fe80b 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -264,19 +264,21 @@ template <class ELFT> void RelocationSection<ELFT>::writeTo(uint8_t *Buf) { bool LazyReloc = Body && Target->supportsLazyRelocations() && Target->relocNeedsPlt(Type, *Body); - unsigned Sym = CanBePreempted ? Body->getDynamicSymbolTableIndex() : 0; - unsigned Rel; - if (!CanBePreempted) - Rel = Target->getRelativeReloc(); - else if (LazyReloc) - Rel = Target->getPltReloc(); - else if (NeedsGot) - Rel = Body->isTLS() ? Target->getTlsGotReloc() : Target->getGotReloc(); - else if (NeedsCopy) - Rel = Target->getCopyReloc(); - else - Rel = Target->getDynReloc(Type); - P->setSymbolAndType(Sym, Rel, Config->Mips64EL); + 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); + } if (NeedsGot) { if (LazyReloc) |

