diff options
| author | Rui Ueyama <ruiu@google.com> | 2015-03-27 01:36:17 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2015-03-27 01:36:17 +0000 |
| commit | c9ee4de6ca41023b9231c234917d284ee8e87da9 (patch) | |
| tree | 3cc903d7c809d4eabbd48720e5ba6ecbaca587e8 /lld/lib/ReaderWriter/ELF/DefaultLayout.h | |
| parent | 12c8f6540886bcf7d375f42c334f6034f56aa439 (diff) | |
| download | bcm5719-llvm-c9ee4de6ca41023b9231c234917d284ee8e87da9.tar.gz bcm5719-llvm-c9ee4de6ca41023b9231c234917d284ee8e87da9.zip | |
Rename ELFLinkingContext instances "ctx" intead of "context".
llvm-svn: 233344
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/DefaultLayout.h')
| -rw-r--r-- | lld/lib/ReaderWriter/ELF/DefaultLayout.h | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/lld/lib/ReaderWriter/ELF/DefaultLayout.h b/lld/lib/ReaderWriter/ELF/DefaultLayout.h index 9af3b8eb8dc..f1d95630df4 100644 --- a/lld/lib/ReaderWriter/ELF/DefaultLayout.h +++ b/lld/lib/ReaderWriter/ELF/DefaultLayout.h @@ -170,8 +170,8 @@ public: typedef llvm::DenseSet<const Atom *> AtomSetT; - DefaultLayout(ELFLinkingContext &context) - : _context(context), _linkerScriptSema(context.linkerScriptSema()) {} + DefaultLayout(ELFLinkingContext &ctx) + : _ctx(ctx), _linkerScriptSema(ctx.linkerScriptSema()) {} /// \brief Return the section order for a input section SectionOrder getSectionOrder(StringRef name, int32_t contentType, @@ -283,7 +283,7 @@ public: RelocationTable<ELFT> *getDynamicRelocationTable() { if (!_dynamicRelocationTable) { _dynamicRelocationTable = std::move(createRelocationTable( - _context.isRelaOutputFormat() ? ".rela.dyn" : ".rel.dyn", + _ctx.isRelaOutputFormat() ? ".rela.dyn" : ".rel.dyn", ORDER_DYNAMIC_RELOCS)); addSection(_dynamicRelocationTable.get()); } @@ -294,7 +294,7 @@ public: RelocationTable<ELFT> *getPLTRelocationTable() { if (!_pltRelocationTable) { _pltRelocationTable = std::move(createRelocationTable( - _context.isRelaOutputFormat() ? ".rela.plt" : ".rel.plt", + _ctx.isRelaOutputFormat() ? ".rela.plt" : ".rel.plt", ORDER_DYNAMIC_PLT_RELOCS)); addSection(_pltRelocationTable.get()); } @@ -335,7 +335,7 @@ protected: virtual unique_bump_ptr<RelocationTable<ELFT>> createRelocationTable(StringRef name, int32_t order) { return unique_bump_ptr<RelocationTable<ELFT>>( - new (_allocator) RelocationTable<ELFT>(_context, name, order)); + new (_allocator) RelocationTable<ELFT>(_ctx, name, order)); } private: @@ -358,7 +358,7 @@ protected: std::vector<lld::AtomLayout *> _absoluteAtoms; AtomSetT _referencedDynAtoms; llvm::StringSet<> _copiedDynSymNames; - ELFLinkingContext &_context; + ELFLinkingContext &_ctx; script::Sema &_linkerScriptSema; }; @@ -570,7 +570,7 @@ template <class ELFT> AtomSection<ELFT> *DefaultLayout<ELFT>::createSection( StringRef sectionName, int32_t contentType, DefinedAtom::ContentPermissions permissions, SectionOrder sectionOrder) { - return new (_allocator) AtomSection<ELFT>(_context, sectionName, contentType, + return new (_allocator) AtomSection<ELFT>(_ctx, sectionName, contentType, permissions, sectionOrder); } @@ -617,10 +617,10 @@ DefaultLayout<ELFT>::addAtom(const Atom *atom) { // Add runtime relocations to the .rela section. for (const auto &reloc : *definedAtom) { bool isLocalReloc = true; - if (_context.isDynamicRelocation(*reloc)) { + if (_ctx.isDynamicRelocation(*reloc)) { getDynamicRelocationTable()->addRelocation(*definedAtom, *reloc); isLocalReloc = false; - } else if (_context.isPLTRelocation(*reloc)) { + } else if (_ctx.isPLTRelocation(*reloc)) { getPLTRelocationTable()->addRelocation(*definedAtom, *reloc); isLocalReloc = false; } @@ -632,7 +632,7 @@ DefaultLayout<ELFT>::addAtom(const Atom *atom) { if (isa<UndefinedAtom>(reloc->target()) && isLocalReloc) continue; - if (_context.isCopyRelocation(*reloc)) { + if (_ctx.isCopyRelocation(*reloc)) { _copiedDynSymNames.insert(definedAtom->name()); continue; } @@ -716,7 +716,7 @@ void DefaultLayout<ELFT>::sortOutputSectionByPriority( template <class ELFT> void DefaultLayout<ELFT>::assignSectionsToSegments() { ScopedTask task(getDefaultDomain(), "assignSectionsToSegments"); - ELFLinkingContext::OutputMagic outputMagic = _context.getOutputMagic(); + ELFLinkingContext::OutputMagic outputMagic = _ctx.getOutputMagic(); // sort the sections by their order as defined by the layout sortInputSections(); @@ -752,7 +752,7 @@ template <class ELFT> void DefaultLayout<ELFT>::assignSectionsToSegments() { int64_t lookupSectionFlag = osi->flags(); if ((!(lookupSectionFlag & llvm::ELF::SHF_WRITE)) && - (_context.mergeRODataToTextSegment())) + (_ctx.mergeRODataToTextSegment())) lookupSectionFlag &= ~llvm::ELF::SHF_EXECINSTR; // Merge string sections into Data segment itself @@ -774,8 +774,8 @@ template <class ELFT> void DefaultLayout<ELFT>::assignSectionsToSegments() { if (!additionalSegmentInsert.second) { segment = additionalSegmentInsert.first->second; } else { - segment = new (_allocator) - Segment<ELFT>(_context, segmentName, segmentType); + segment = + new (_allocator) Segment<ELFT>(_ctx, segmentName, segmentType); additionalSegmentInsert.first->second = segment; _segments.push_back(segment); } @@ -802,7 +802,7 @@ template <class ELFT> void DefaultLayout<ELFT>::assignSectionsToSegments() { segment = segmentInsert.first->second; } else { segment = new (_allocator) - Segment<ELFT>(_context, "PT_LOAD", llvm::ELF::PT_LOAD); + Segment<ELFT>(_ctx, "PT_LOAD", llvm::ELF::PT_LOAD); segmentInsert.first->second = segment; _segments.push_back(segment); } @@ -815,9 +815,8 @@ template <class ELFT> void DefaultLayout<ELFT>::assignSectionsToSegments() { } } } - if (_context.isDynamic() && !_context.isDynamicLibrary()) { - Segment<ELFT> *segment = - new (_allocator) ProgramHeaderSegment<ELFT>(_context); + if (_ctx.isDynamic() && !_ctx.isDynamicLibrary()) { + Segment<ELFT> *segment = new (_allocator) ProgramHeaderSegment<ELFT>(_ctx); _segments.push_back(segment); segment->append(_elfHeader); segment->append(_programHeader); @@ -832,7 +831,7 @@ DefaultLayout<ELFT>::assignVirtualAddress() { std::sort(_segments.begin(), _segments.end(), Segment<ELFT>::compareSegments); - uint64_t baseAddress = _context.getBaseAddress(); + uint64_t baseAddress = _ctx.getBaseAddress(); // HACK: This is a super dirty hack. The elf header and program header are // not part of a section, but we need them to be loaded at the base address @@ -1039,7 +1038,7 @@ void DefaultLayout<ELFT>::addExtraChunksToSegment(Segment<ELFT> *segment, _linkerScriptSema.getExprs({archivePath, memberPath, sectionName}); for (auto expr : exprs) { auto expChunk = - new (this->_allocator) ExpressionChunk<ELFT>(this->_context, expr); + new (this->_allocator) ExpressionChunk<ELFT>(this->_ctx, expr); segment->append(expChunk); } } |

