[lld] r207435 - [Mips] Convert MipsDynamicSymbolTable to the class template.
Simon Atanasyan
simon at atanasyan.com
Mon Apr 28 12:34:34 PDT 2014
Author: atanasyan
Date: Mon Apr 28 14:34:34 2014
New Revision: 207435
URL: http://llvm.org/viewvc/llvm-project?rev=207435&view=rev
Log:
[Mips] Convert MipsDynamicSymbolTable to the class template.
Modified:
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h?rev=207435&r1=207434&r2=207435&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h Mon Apr 28 14:34:34 2014
@@ -93,8 +93,9 @@ LLD_UNIQUE_BUMP_PTR(DynamicTable<ELFT>)
template <class ELFT>
LLD_UNIQUE_BUMP_PTR(DynamicSymbolTable<ELFT>)
MipsDynamicLibraryWriter<ELFT>::createDynamicSymbolTable() {
- return LLD_UNIQUE_BUMP_PTR(DynamicSymbolTable<ELFT>)(new (
- this->_alloc) MipsDynamicSymbolTable(_mipsContext, _mipsTargetLayout));
+ return LLD_UNIQUE_BUMP_PTR(
+ DynamicSymbolTable<ELFT>)(new (this->_alloc) MipsDynamicSymbolTable<ELFT>(
+ _mipsContext, _mipsTargetLayout));
}
} // namespace elf
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h?rev=207435&r1=207434&r2=207435&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h Mon Apr 28 14:34:34 2014
@@ -109,8 +109,9 @@ LLD_UNIQUE_BUMP_PTR(DynamicTable<ELFT>)
template <class ELFT>
LLD_UNIQUE_BUMP_PTR(DynamicSymbolTable<ELFT>)
MipsExecutableWriter<ELFT>::createDynamicSymbolTable() {
- return LLD_UNIQUE_BUMP_PTR(DynamicSymbolTable<ELFT>)(new (
- this->_alloc) MipsDynamicSymbolTable(_mipsContext, _mipsTargetLayout));
+ return LLD_UNIQUE_BUMP_PTR(
+ DynamicSymbolTable<ELFT>)(new (this->_alloc) MipsDynamicSymbolTable<ELFT>(
+ _mipsContext, _mipsTargetLayout));
}
} // namespace elf
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h?rev=207435&r1=207434&r2=207435&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h Mon Apr 28 14:34:34 2014
@@ -97,17 +97,19 @@ private:
std::unique_ptr<MipsTargetRelocationHandler> _relocationHandler;
};
-class MipsDynamicSymbolTable : public DynamicSymbolTable<Mips32ElELFType> {
+template <class ELFT>
+class MipsDynamicSymbolTable : public DynamicSymbolTable<ELFT> {
public:
MipsDynamicSymbolTable(const MipsLinkingContext &context,
- MipsTargetLayout<Mips32ElELFType> &layout)
- : DynamicSymbolTable<Mips32ElELFType>(
+ MipsTargetLayout<ELFT> &layout)
+ : DynamicSymbolTable<ELFT>(
context, layout, ".dynsym",
- DefaultLayout<Mips32ElELFType>::ORDER_DYNAMIC_SYMBOLS),
+ DefaultLayout<ELFT>::ORDER_DYNAMIC_SYMBOLS),
_targetLayout(layout) {}
void sortSymbols() override {
- std::stable_sort(_symbolTable.begin(), _symbolTable.end(),
+ typedef typename DynamicSymbolTable<ELFT>::SymbolEntry SymbolEntry;
+ std::stable_sort(this->_symbolTable.begin(), this->_symbolTable.end(),
[this](const SymbolEntry &A, const SymbolEntry &B) {
if (A._symbol.getBinding() != STB_GLOBAL &&
B._symbol.getBinding() != STB_GLOBAL)
@@ -118,7 +120,7 @@ public:
}
private:
- MipsTargetLayout<Mips32ElELFType> &_targetLayout;
+ MipsTargetLayout<ELFT> &_targetLayout;
};
} // end namespace elf
More information about the llvm-commits
mailing list