[lld] db6a00d - [ELF] Remove unneeded binding parameter from addOptionalRegular. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 25 15:47:31 PDT 2021
Author: Fangrui Song
Date: 2021-09-25T15:47:27-07:00
New Revision: db6a00daa081a1664c4b714e28042d3803b7e1f4
URL: https://github.com/llvm/llvm-project/commit/db6a00daa081a1664c4b714e28042d3803b7e1f4
DIFF: https://github.com/llvm/llvm-project/commit/db6a00daa081a1664c4b714e28042d3803b7e1f4.diff
LOG: [ELF] Remove unneeded binding parameter from addOptionalRegular. NFC
__rela_iplt_start uses spurious STB_WEAK, but it doesn't matter because STV_HIDDEN overrides the binding.
Added:
Modified:
lld/ELF/Writer.cpp
Removed:
################################################################################
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 0fdc64852b9d..7a3b2747042e 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -226,13 +226,13 @@ void elf::combineEhSections() {
}
static Defined *addOptionalRegular(StringRef name, SectionBase *sec,
- uint64_t val, uint8_t stOther = STV_HIDDEN,
- uint8_t binding = STB_GLOBAL) {
+ uint64_t val, uint8_t stOther = STV_HIDDEN) {
Symbol *s = symtab->find(name);
if (!s || s->isDefined())
return nullptr;
- s->resolve(Defined{/*file=*/nullptr, name, binding, stOther, STT_NOTYPE, val,
+ s->resolve(Defined{/*file=*/nullptr, name, STB_GLOBAL, stOther, STT_NOTYPE,
+ val,
/*size=*/0, sec});
return cast<Defined>(s);
}
@@ -1098,11 +1098,11 @@ template <class ELFT> void Writer<ELFT>::addRelIpltSymbols() {
// sure that .rela.plt exists in output.
ElfSym::relaIpltStart = addOptionalRegular(
config->isRela ? "__rela_iplt_start" : "__rel_iplt_start",
- Out::elfHeader, 0, STV_HIDDEN, STB_WEAK);
+ Out::elfHeader, 0, STV_HIDDEN);
ElfSym::relaIpltEnd = addOptionalRegular(
config->isRela ? "__rela_iplt_end" : "__rel_iplt_end",
- Out::elfHeader, 0, STV_HIDDEN, STB_WEAK);
+ Out::elfHeader, 0, STV_HIDDEN);
}
template <class ELFT>
@@ -1966,7 +1966,7 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
OutputSection *sec = findSection(".sdata");
ElfSym::riscvGlobalPointer =
addOptionalRegular("__global_pointer$", sec ? sec : Out::elfHeader,
- 0x800, STV_DEFAULT, STB_GLOBAL);
+ 0x800, STV_DEFAULT);
}
if (config->emachine == EM_X86_64) {
More information about the llvm-commits
mailing list