aboutsummaryrefslogtreecommitdiffstats
path: root/ELF/OutputSections.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-16 19:47:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-16 19:47:41 +0000
commit022ebf5bbf58ca2dd943d3376cc95a6b206db799 (patch)
tree4069ef3b75eed2d68683cb6224a627c24cd95b15 /ELF/OutputSections.cpp
parentfbe69f787ace06f44b6cb1bd3cd45ac703a16a05 (diff)
downloadsrc-022ebf5bbf58ca2dd943d3376cc95a6b206db799.tar.gz
src-022ebf5bbf58ca2dd943d3376cc95a6b206db799.zip
Vendor import of lld trunk r303197:vendor/lld/lld-trunk-r303197
Notes
Notes: svn path=/vendor/lld/dist/; revision=318376 svn path=/vendor/lld/lld-trunk-r303197/; revision=318377; tag=vendor/lld/lld-trunk-r303197
Diffstat (limited to 'ELF/OutputSections.cpp')
-rw-r--r--ELF/OutputSections.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/ELF/OutputSections.cpp b/ELF/OutputSections.cpp
index cb9c57657af3..dcefd03766d7 100644
--- a/ELF/OutputSections.cpp
+++ b/ELF/OutputSections.cpp
@@ -133,7 +133,7 @@ template <class ELFT> void OutputSection::finalize() {
if (isa<SyntheticSection>(First))
return;
- this->Link = In<ELFT>::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<uint32_t> Filler = Script->getFiller(Name))
+ if (Optional<uint32_t> Filler = Script->getFiller(this))
return *Filler;
if (Flags & SHF_EXECINSTR)
return Target->TrapInstr;
@@ -297,7 +297,7 @@ template <class ELFT> 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<ELFT>(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 {