From 1b59f27c9a49705c0390ee214fc4caee45edb0c7 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 26 Jul 2016 17:35:42 +0000 Subject: [PATCH] Add `static` to a function that is used only in one file. llvm-svn: 276774 --- lld/ELF/Writer.cpp | 11 +++-------- lld/ELF/Writer.h | 1 - 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index f14358ac114e..88f243d9125d 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -930,7 +930,7 @@ void Writer::addStartStopSymbols(OutputSectionBase *Sec) { Symtab.addSynthetic(Stop, Sec, DefinedSynthetic::SectionEnd); } -template bool elf::needsPtLoad(OutputSectionBase *Sec) { +template static bool needsPtLoad(OutputSectionBase *Sec) { if (!(Sec->getFlags() & SHF_ALLOC)) return false; @@ -982,7 +982,7 @@ std::vector> Writer::createPhdrs() { if (Sec->getFlags() & SHF_TLS) TlsHdr.add(Sec); - if (!needsPtLoad(Sec)) + if (!needsPtLoad(Sec)) continue; // If flags changed then we want new load segment. @@ -1077,7 +1077,7 @@ template void Writer::assignAddresses() { Alignment = std::max(Alignment, Target->PageSize); // We only assign VAs to allocated sections. - if (needsPtLoad(Sec)) { + if (needsPtLoad(Sec)) { VA = alignTo(VA, Alignment); Sec->setVA(VA); VA += Sec->getSize(); @@ -1338,11 +1338,6 @@ template bool elf::isRelroSection(OutputSectionBase *); template bool elf::isRelroSection(OutputSectionBase *); template bool elf::isRelroSection(OutputSectionBase *); -template bool elf::needsPtLoad(OutputSectionBase *); -template bool elf::needsPtLoad(OutputSectionBase *); -template bool elf::needsPtLoad(OutputSectionBase *); -template bool elf::needsPtLoad(OutputSectionBase *); - template StringRef elf::getOutputSectionName(InputSectionBase *); template StringRef elf::getOutputSectionName(InputSectionBase *); template StringRef elf::getOutputSectionName(InputSectionBase *); diff --git a/lld/ELF/Writer.h b/lld/ELF/Writer.h index 2e3982957a16..f9c8b6322009 100644 --- a/lld/ELF/Writer.h +++ b/lld/ELF/Writer.h @@ -27,7 +27,6 @@ template void writeResult(SymbolTable *Symtab); template void markLive(); template bool isOutputDynamic(); template bool isRelroSection(OutputSectionBase *Sec); -template bool needsPtLoad(OutputSectionBase *Sec); uint32_t toPhdrFlags(uint64_t Flags); // This describes a program header entry.