From 390242d0e9571388aa3be5f9c259f9673b6ae151 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Tue, 16 May 2017 10:11:36 +0000 Subject: [PATCH] [ELF] - Detemplate elf::addSyntheticLocal(). NFC. llvm-svn: 303155 --- lld/ELF/SyntheticSections.cpp | 14 -------------- lld/ELF/SyntheticSections.h | 2 +- lld/ELF/Target.cpp | 8 ++++---- lld/ELF/Thunks.cpp | 18 +++++++++--------- 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index c473dfe..216eaa9 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -293,7 +293,6 @@ InputSection *elf::createInterpSection() { return Sec; } -template SymbolBody *elf::addSyntheticLocal(StringRef Name, uint8_t Type, uint64_t Value, uint64_t Size, InputSectionBase *Section) { auto *S = make(Name, /*IsLocal*/ true, STV_DEFAULT, Type, @@ -2270,19 +2269,6 @@ template MergeInputSection *elf::createCommentSection(); template MergeInputSection *elf::createCommentSection(); template MergeInputSection *elf::createCommentSection(); -template SymbolBody *elf::addSyntheticLocal(StringRef, uint8_t, - uint64_t, uint64_t, - InputSectionBase *); -template SymbolBody *elf::addSyntheticLocal(StringRef, uint8_t, - uint64_t, uint64_t, - InputSectionBase *); -template SymbolBody *elf::addSyntheticLocal(StringRef, uint8_t, - uint64_t, uint64_t, - InputSectionBase *); -template SymbolBody *elf::addSyntheticLocal(StringRef, uint8_t, - uint64_t, uint64_t, - InputSectionBase *); - template class elf::MipsAbiFlagsSection; template class elf::MipsAbiFlagsSection; template class elf::MipsAbiFlagsSection; diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index b9ee3be..0477c60 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -747,7 +747,7 @@ private: template InputSection *createCommonSection(); InputSection *createInterpSection(); template MergeInputSection *createCommentSection(); -template + SymbolBody *addSyntheticLocal(StringRef Name, uint8_t Type, uint64_t Value, uint64_t Size, InputSectionBase *Section); diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index f367ad0..781d7fe 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -1762,8 +1762,8 @@ void ARMTargetInfo::writePltHeader(uint8_t *Buf) const { void ARMTargetInfo::addPltHeaderSymbols(InputSectionBase *ISD) const { auto *IS = cast(ISD); - addSyntheticLocal("$a", STT_NOTYPE, 0, 0, IS); - addSyntheticLocal("$d", STT_NOTYPE, 16, 0, IS); + addSyntheticLocal("$a", STT_NOTYPE, 0, 0, IS); + addSyntheticLocal("$d", STT_NOTYPE, 16, 0, IS); } void ARMTargetInfo::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, @@ -1785,8 +1785,8 @@ void ARMTargetInfo::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, void ARMTargetInfo::addPltSymbols(InputSectionBase *ISD, uint64_t Off) const { auto *IS = cast(ISD); - addSyntheticLocal("$a", STT_NOTYPE, Off, 0, IS); - addSyntheticLocal("$d", STT_NOTYPE, Off + 12, 0, IS); + addSyntheticLocal("$a", STT_NOTYPE, Off, 0, IS); + addSyntheticLocal("$d", STT_NOTYPE, Off + 12, 0, IS); } bool ARMTargetInfo::needsThunk(RelExpr Expr, uint32_t RelocType, diff --git a/lld/ELF/Thunks.cpp b/lld/ELF/Thunks.cpp index 307ca5d..80ea696 100644 --- a/lld/ELF/Thunks.cpp +++ b/lld/ELF/Thunks.cpp @@ -124,10 +124,10 @@ void ARMV7ABSLongThunk::writeTo(uint8_t *Buf, ThunkSection &IS) const { template void ARMV7ABSLongThunk::addSymbols(ThunkSection &IS) { - this->ThunkSym = addSyntheticLocal( + this->ThunkSym = addSyntheticLocal( Saver.save("__ARMv7ABSLongThunk_" + this->Destination.getName()), STT_FUNC, this->Offset, size(), &IS); - addSyntheticLocal("$a", STT_NOTYPE, this->Offset, 0, &IS); + addSyntheticLocal("$a", STT_NOTYPE, this->Offset, 0, &IS); } template @@ -145,10 +145,10 @@ void ThumbV7ABSLongThunk::writeTo(uint8_t *Buf, ThunkSection &IS) const { template void ThumbV7ABSLongThunk::addSymbols(ThunkSection &IS) { - this->ThunkSym = addSyntheticLocal( + this->ThunkSym = addSyntheticLocal( Saver.save("__Thumbv7ABSLongThunk_" + this->Destination.getName()), STT_FUNC, this->Offset, size(), &IS); - addSyntheticLocal("$t", STT_NOTYPE, this->Offset, 0, &IS); + addSyntheticLocal("$t", STT_NOTYPE, this->Offset, 0, &IS); } template @@ -168,10 +168,10 @@ void ARMV7PILongThunk::writeTo(uint8_t *Buf, ThunkSection &IS) const { template void ARMV7PILongThunk::addSymbols(ThunkSection &IS) { - this->ThunkSym = addSyntheticLocal( + this->ThunkSym = addSyntheticLocal( Saver.save("__ARMV7PILongThunk_" + this->Destination.getName()), STT_FUNC, this->Offset, size(), &IS); - addSyntheticLocal("$a", STT_NOTYPE, this->Offset, 0, &IS); + addSyntheticLocal("$a", STT_NOTYPE, this->Offset, 0, &IS); } template @@ -191,10 +191,10 @@ void ThumbV7PILongThunk::writeTo(uint8_t *Buf, ThunkSection &IS) const { template void ThumbV7PILongThunk::addSymbols(ThunkSection &IS) { - this->ThunkSym = addSyntheticLocal( + this->ThunkSym = addSyntheticLocal( Saver.save("__ThumbV7PILongThunk_" + this->Destination.getName()), STT_FUNC, this->Offset, size(), &IS); - addSyntheticLocal("$t", STT_NOTYPE, this->Offset, 0, &IS); + addSyntheticLocal("$t", STT_NOTYPE, this->Offset, 0, &IS); } // Write MIPS LA25 thunk code to call PIC function from the non-PIC one. @@ -212,7 +212,7 @@ void MipsThunk::writeTo(uint8_t *Buf, ThunkSection &) const { } template void MipsThunk::addSymbols(ThunkSection &IS) { - this->ThunkSym = addSyntheticLocal( + this->ThunkSym = addSyntheticLocal( Saver.save("__LA25Thunk_" + this->Destination.getName()), STT_FUNC, this->Offset, size(), &IS); } -- 2.7.4