diff options
Diffstat (limited to 'contrib/llvm-project/lld/ELF/OutputSections.cpp')
-rw-r--r-- | contrib/llvm-project/lld/ELF/OutputSections.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/contrib/llvm-project/lld/ELF/OutputSections.cpp b/contrib/llvm-project/lld/ELF/OutputSections.cpp index a17f713b742a..4a03ac387814 100644 --- a/contrib/llvm-project/lld/ELF/OutputSections.cpp +++ b/contrib/llvm-project/lld/ELF/OutputSections.cpp @@ -40,7 +40,7 @@ OutputSection *Out::preinitArray; OutputSection *Out::initArray; OutputSection *Out::finiArray; -std::vector<OutputSection *> elf::outputSections; +SmallVector<OutputSection *, 0> elf::outputSections; uint32_t OutputSection::getPhdrFlags() const { uint32_t ret = 0; @@ -155,6 +155,15 @@ void OutputSection::commitSection(InputSection *isec) { entsize = 0; } +static MergeSyntheticSection *createMergeSynthetic(StringRef name, + uint32_t type, + uint64_t flags, + uint32_t alignment) { + if ((flags & SHF_STRINGS) && config->optimize >= 2) + return make<MergeTailSection>(name, type, flags, alignment); + return make<MergeNoTailSection>(name, type, flags, alignment); +} + // This function scans over the InputSectionBase list sectionBases to create // InputSectionDescription::sections. // @@ -323,6 +332,7 @@ static void writeInt(uint8_t *buf, uint64_t data, uint64_t size) { } template <class ELFT> void OutputSection::writeTo(uint8_t *buf) { + llvm::TimeTraceScope timeScope("Write sections", name); if (type == SHT_NOBITS) return; @@ -550,7 +560,7 @@ void OutputSection::checkDynRelAddends(const uint8_t *bufStart) { if (!sec) return; for (const DynamicReloc &rel : sec->relocs) { - int64_t addend = rel.computeAddend(); + int64_t addend = rel.addend; const OutputSection *relOsec = rel.inputSec->getOutputSection(); assert(relOsec != nullptr && "missing output section for relocation"); const uint8_t *relocTarget = |