From 022ebf5bbf58ca2dd943d3376cc95a6b206db799 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 16 May 2017 19:47:41 +0000 Subject: Vendor import of lld trunk r303197: https://llvm.org/svn/llvm-project/lld/trunk@303197 --- ELF/OutputSections.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ELF/OutputSections.cpp') diff --git a/ELF/OutputSections.cpp b/ELF/OutputSections.cpp index cb9c57657af32..dcefd03766d79 100644 --- a/ELF/OutputSections.cpp +++ b/ELF/OutputSections.cpp @@ -133,7 +133,7 @@ template void OutputSection::finalize() { if (isa(First)) return; - this->Link = In::SymTab->OutSec->SectionIndex; + this->Link = InX::SymTab->OutSec->SectionIndex; // sh_info for SHT_REL[A] sections should contain the section header index of // the section to which the relocation applies. InputSectionBase *S = First->getRelocatedSection(); @@ -273,7 +273,7 @@ uint32_t OutputSection::getFiller() { // linker script. If nothing is specified and this is an executable section, // fall back to trap instructions to prevent bad diassembly and detect invalid // jumps to padding. - if (Optional Filler = Script->getFiller(Name)) + if (Optional Filler = Script->getFiller(this)) return *Filler; if (Flags & SHF_EXECINSTR) return Target->TrapInstr; @@ -297,7 +297,7 @@ template void OutputSection::writeTo(uint8_t *Buf) { if (Filler) fill(Buf, Sections.empty() ? Size : Sections[0]->OutSecOff, Filler); - parallelFor(0, Sections.size(), [=](size_t I) { + parallelForEachN(0, Sections.size(), [=](size_t I) { InputSection *Sec = Sections[I]; Sec->writeTo(Buf); @@ -429,8 +429,11 @@ void OutputSectionFactory::addInputSec(InputSectionBase *IS, if (canMergeToProgbits(Sec->Type) && canMergeToProgbits(IS->Type)) Sec->Type = SHT_PROGBITS; else - error("Section has different type from others with the same name " + - toString(IS)); + error("section type mismatch for " + IS->Name + + "\n>>> " + toString(IS) + ": " + + getELFSectionTypeName(Config->EMachine, IS->Type) + + "\n>>> output section " + Sec->Name + ": " + + getELFSectionTypeName(Config->EMachine, Sec->Type)); } Sec->Flags |= Flags; } else { -- cgit v1.2.3