[lld] r367117 - [ELF] Detemplate maybeReportUndefined and copySectionsIntoPartitions
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 26 07:57:53 PDT 2019
Author: maskray
Date: Fri Jul 26 07:57:53 2019
New Revision: 367117
URL: http://llvm.org/viewvc/llvm-project?rev=367117&view=rev
Log:
[ELF] Detemplate maybeReportUndefined and copySectionsIntoPartitions
Modified:
lld/trunk/ELF/Relocations.cpp
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=367117&r1=367116&r2=367117&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Fri Jul 26 07:57:53 2019
@@ -766,7 +766,6 @@ template <class ELFT> void elf::reportUn
// Report an undefined symbol if necessary.
// Returns true if the undefined symbol will produce an error message.
-template <class ELFT>
static bool maybeReportUndefined(Symbol &sym, InputSectionBase &sec,
uint64_t offset) {
if (!sym.isUndefined() || sym.isWeak())
@@ -1125,7 +1124,7 @@ static void scanReloc(InputSectionBase &
// Error if the target symbol is undefined. Symbol index 0 may be used by
// marker relocations, e.g. R_*_NONE and R_ARM_V4BX. Don't error on them.
- if (symIndex != 0 && maybeReportUndefined<ELFT>(sym, sec, rel.r_offset))
+ if (symIndex != 0 && maybeReportUndefined(sym, sec, rel.r_offset))
return;
const uint8_t *relocatedAddr = sec.data().begin() + rel.r_offset;
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=367117&r1=367116&r2=367117&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Fri Jul 26 07:57:53 2019
@@ -154,7 +154,7 @@ void Writer<ELFT>::removeEmptyPTLoad(std
});
}
-template <class ELFT> static void copySectionsIntoPartitions() {
+static void copySectionsIntoPartitions() {
std::vector<InputSectionBase *> newSections;
for (unsigned part = 2; part != partitions.size() + 1; ++part) {
for (InputSectionBase *s : inputSections) {
@@ -546,7 +546,7 @@ template <class ELFT> static void create
template <class ELFT> void Writer<ELFT>::run() {
// Make copies of any input sections that need to be copied into each
// partition.
- copySectionsIntoPartitions<ELFT>();
+ copySectionsIntoPartitions();
// Create linker-synthesized sections such as .got or .plt.
// Such sections are of type input section.
More information about the llvm-commits
mailing list