Index: lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h =================================================================== --- lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h +++ lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h @@ -38,21 +38,20 @@ private: void addDefaultAtoms() { - _hexagonRuntimeFile->addAbsoluteAtom("_GLOBAL_OFFSET_TABLE_"); - _hexagonRuntimeFile->addAbsoluteAtom("_DYNAMIC"); + _runtimeFile->addAbsoluteAtom("_GLOBAL_OFFSET_TABLE_"); + _runtimeFile->addAbsoluteAtom("_DYNAMIC"); } HexagonLinkingContext &_ctx; - HexagonTargetLayout &_hexagonTargetLayout; - std::unique_ptr> _hexagonRuntimeFile; + HexagonTargetLayout &_targetLayout; + std::unique_ptr> _runtimeFile; }; template HexagonDynamicLibraryWriter::HexagonDynamicLibraryWriter( HexagonLinkingContext &ctx, HexagonTargetLayout &layout) - : DynamicLibraryWriter(ctx, layout), _ctx(ctx), - _hexagonTargetLayout(layout), - _hexagonRuntimeFile(new HexagonRuntimeFile(ctx)) {} + : DynamicLibraryWriter(ctx, layout), _ctx(ctx), _targetLayout(layout), + _runtimeFile(new HexagonRuntimeFile(ctx)) {} template bool HexagonDynamicLibraryWriter::createImplicitFiles( @@ -60,7 +59,7 @@ DynamicLibraryWriter::createImplicitFiles(result); // Add the default atoms as defined for hexagon addDefaultAtoms(); - result.push_back(std::move(_hexagonRuntimeFile)); + result.push_back(std::move(_runtimeFile)); return true; } @@ -69,7 +68,7 @@ // Finalize the atom values that are part of the parent. DynamicLibraryWriter::finalizeDefaultAtomValues(); if (_ctx.isDynamic()) - finalizeHexagonRuntimeAtomValues(_hexagonTargetLayout); + finalizeHexagonRuntimeAtomValues(_targetLayout); } } // namespace elf Index: lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h =================================================================== --- lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h +++ lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h @@ -38,24 +38,23 @@ private: void addDefaultAtoms() { - _hexagonRuntimeFile->addAbsoluteAtom("_SDA_BASE_"); + _runtimeFile->addAbsoluteAtom("_SDA_BASE_"); if (this->_ctx.isDynamic()) { - _hexagonRuntimeFile->addAbsoluteAtom("_GLOBAL_OFFSET_TABLE_"); - _hexagonRuntimeFile->addAbsoluteAtom("_DYNAMIC"); + _runtimeFile->addAbsoluteAtom("_GLOBAL_OFFSET_TABLE_"); + _runtimeFile->addAbsoluteAtom("_DYNAMIC"); } } HexagonLinkingContext &_ctx; - HexagonTargetLayout &_hexagonTargetLayout; - std::unique_ptr> _hexagonRuntimeFile; + HexagonTargetLayout &_targetLayout; + std::unique_ptr> _runtimeFile; }; template HexagonExecutableWriter::HexagonExecutableWriter( HexagonLinkingContext &ctx, HexagonTargetLayout &layout) - : ExecutableWriter(ctx, layout), _ctx(ctx), - _hexagonTargetLayout(layout), - _hexagonRuntimeFile(new HexagonRuntimeFile(ctx)) {} + : ExecutableWriter(ctx, layout), _ctx(ctx), _targetLayout(layout), + _runtimeFile(new HexagonRuntimeFile(ctx)) {} template bool HexagonExecutableWriter::createImplicitFiles( @@ -63,7 +62,7 @@ ExecutableWriter::createImplicitFiles(result); // Add the default atoms as defined for hexagon addDefaultAtoms(); - result.push_back(std::move(_hexagonRuntimeFile)); + result.push_back(std::move(_runtimeFile)); return true; } @@ -71,11 +70,11 @@ void HexagonExecutableWriter::finalizeDefaultAtomValues() { // Finalize the atom values that are part of the parent. ExecutableWriter::finalizeDefaultAtomValues(); - auto sdabaseAtomIter = _hexagonTargetLayout.findAbsoluteAtom("_SDA_BASE_"); + auto sdabaseAtomIter = _targetLayout.findAbsoluteAtom("_SDA_BASE_"); (*sdabaseAtomIter)->_virtualAddr = - _hexagonTargetLayout.getSDataSection()->virtualAddr(); + _targetLayout.getSDataSection()->virtualAddr(); if (_ctx.isDynamic()) - finalizeHexagonRuntimeAtomValues(_hexagonTargetLayout); + finalizeHexagonRuntimeAtomValues(_targetLayout); } } // namespace elf Index: lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h =================================================================== --- lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h +++ lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h @@ -21,14 +21,14 @@ class HexagonTargetRelocationHandler final : public TargetRelocationHandler { public: HexagonTargetRelocationHandler(HexagonTargetLayout &layout) - : _hexagonTargetLayout(layout) {} + : _targetLayout(layout) {} std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, const lld::AtomLayout &, const Reference &) const override; private: - HexagonTargetLayout &_hexagonTargetLayout; + HexagonTargetLayout &_targetLayout; }; } // elf } // lld Index: lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp =================================================================== --- lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp +++ lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp @@ -262,19 +262,19 @@ break; case R_HEX_GPREL16_0: relocHexGPRELN(location, relocVAddress, targetVAddress, ref.addend(), - _hexagonTargetLayout.getSDataSection()->virtualAddr(), 0); + _targetLayout.getSDataSection()->virtualAddr(), 0); break; case R_HEX_GPREL16_1: relocHexGPRELN(location, relocVAddress, targetVAddress, ref.addend(), - _hexagonTargetLayout.getSDataSection()->virtualAddr(), 1); + _targetLayout.getSDataSection()->virtualAddr(), 1); break; case R_HEX_GPREL16_2: relocHexGPRELN(location, relocVAddress, targetVAddress, ref.addend(), - _hexagonTargetLayout.getSDataSection()->virtualAddr(), 2); + _targetLayout.getSDataSection()->virtualAddr(), 2); break; case R_HEX_GPREL16_3: relocHexGPRELN(location, relocVAddress, targetVAddress, ref.addend(), - _hexagonTargetLayout.getSDataSection()->virtualAddr(), 3); + _targetLayout.getSDataSection()->virtualAddr(), 3); break; case R_HEX_16_X: case R_HEX_12_X: @@ -294,52 +294,45 @@ break; case R_HEX_GOTREL_32: relocHexGOTREL_32(location, relocVAddress, targetVAddress, ref.addend(), - _hexagonTargetLayout.getGOTSymAddr()); + _targetLayout.getGOTSymAddr()); break; case R_HEX_GOTREL_LO16: relocHexGOTREL_HILO16(location, relocVAddress, targetVAddress, ref.addend(), - _hexagonTargetLayout.getGOTSymAddr()); + _targetLayout.getGOTSymAddr()); break; case R_HEX_GOTREL_HI16: relocHexGOTREL_HILO16(location, relocVAddress, targetVAddress, ref.addend(), - _hexagonTargetLayout.getGOTSymAddr(), 16); + _targetLayout.getGOTSymAddr(), 16); break; case R_HEX_GOT_LO16: - relocHexGOTLO16(location, targetVAddress, - _hexagonTargetLayout.getGOTSymAddr()); + relocHexGOTLO16(location, targetVAddress, _targetLayout.getGOTSymAddr()); break; case R_HEX_GOT_HI16: - relocHexGOTHI16(location, targetVAddress, - _hexagonTargetLayout.getGOTSymAddr()); + relocHexGOTHI16(location, targetVAddress, _targetLayout.getGOTSymAddr()); break; case R_HEX_GOT_32: - relocHexGOT32(location, targetVAddress, - _hexagonTargetLayout.getGOTSymAddr()); + relocHexGOT32(location, targetVAddress, _targetLayout.getGOTSymAddr()); break; case R_HEX_GOT_16: - relocHexGOT16(location, targetVAddress, - _hexagonTargetLayout.getGOTSymAddr()); + relocHexGOT16(location, targetVAddress, _targetLayout.getGOTSymAddr()); break; case R_HEX_GOT_32_6_X: - relocHexGOT32_6_X(location, targetVAddress, - _hexagonTargetLayout.getGOTSymAddr()); + relocHexGOT32_6_X(location, targetVAddress, _targetLayout.getGOTSymAddr()); break; case R_HEX_GOT_16_X: - relocHexGOT16_X(location, targetVAddress, - _hexagonTargetLayout.getGOTSymAddr()); + relocHexGOT16_X(location, targetVAddress, _targetLayout.getGOTSymAddr()); break; case R_HEX_GOT_11_X: - relocHexGOT11_X(location, targetVAddress, - _hexagonTargetLayout.getGOTSymAddr()); + relocHexGOT11_X(location, targetVAddress, _targetLayout.getGOTSymAddr()); break; case R_HEX_GOTREL_32_6_X: relocHexGOTRELSigned(location, relocVAddress, targetVAddress, ref.addend(), - _hexagonTargetLayout.getGOTSymAddr(), 6); + _targetLayout.getGOTSymAddr(), 6); break; case R_HEX_GOTREL_16_X: case R_HEX_GOTREL_11_X: relocHexGOTRELUnsigned(location, relocVAddress, targetVAddress, - ref.addend(), _hexagonTargetLayout.getGOTSymAddr()); + ref.addend(), _targetLayout.getGOTSymAddr()); break; default: Index: lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h =================================================================== --- lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h +++ lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h @@ -110,11 +110,11 @@ void registerRelocationNames(Registry ®istry) override; const HexagonTargetRelocationHandler &getRelocationHandler() const override { - return *_hexagonRelocationHandler; + return *_relocationHandler; } HexagonTargetLayout &getTargetLayout() override { - return *_hexagonTargetLayout; + return *_targetLayout; } std::unique_ptr getObjReader() override { @@ -131,9 +131,9 @@ llvm::BumpPtrAllocator _alloc; static const Registry::KindStrings kindStrings[]; HexagonLinkingContext &_ctx; - std::unique_ptr > _hexagonRuntimeFile; - std::unique_ptr> _hexagonTargetLayout; - std::unique_ptr _hexagonRelocationHandler; + std::unique_ptr> _runtimeFile; + std::unique_ptr> _targetLayout; + std::unique_ptr _relocationHandler; }; template Index: lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp =================================================================== --- lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp +++ lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp @@ -19,20 +19,18 @@ using llvm::makeArrayRef; HexagonTargetHandler::HexagonTargetHandler(HexagonLinkingContext &ctx) - : _ctx(ctx), - _hexagonRuntimeFile(new HexagonRuntimeFile(ctx)), - _hexagonTargetLayout(new HexagonTargetLayout(ctx)), - _hexagonRelocationHandler( - new HexagonTargetRelocationHandler(*_hexagonTargetLayout)) {} + : _ctx(ctx), _runtimeFile(new HexagonRuntimeFile(ctx)), + _targetLayout(new HexagonTargetLayout(ctx)), + _relocationHandler(new HexagonTargetRelocationHandler(*_targetLayout)) {} std::unique_ptr HexagonTargetHandler::getWriter() { switch (_ctx.getOutputELFType()) { case llvm::ELF::ET_EXEC: return llvm::make_unique>( - _ctx, *_hexagonTargetLayout.get()); + _ctx, *_targetLayout.get()); case llvm::ELF::ET_DYN: return llvm::make_unique>( - _ctx, *_hexagonTargetLayout.get()); + _ctx, *_targetLayout.get()); case llvm::ELF::ET_REL: llvm_unreachable("TODO: support -r mode"); default: