Skip to content

Commit f3f594c

Browse files
authored
[NFC][lld] Pass sym as const reference to GotSection's methods (llvm#86481)
1 parent ea798a7 commit f3f594c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lld/ELF/SyntheticSections.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,19 +628,19 @@ GotSection::GotSection()
628628
}
629629

630630
void GotSection::addConstant(const Relocation &r) { relocations.push_back(r); }
631-
void GotSection::addEntry(Symbol &sym) {
631+
void GotSection::addEntry(const Symbol &sym) {
632632
assert(sym.auxIdx == symAux.size() - 1);
633633
symAux.back().gotIdx = numEntries++;
634634
}
635635

636-
bool GotSection::addTlsDescEntry(Symbol &sym) {
636+
bool GotSection::addTlsDescEntry(const Symbol &sym) {
637637
assert(sym.auxIdx == symAux.size() - 1);
638638
symAux.back().tlsDescIdx = numEntries;
639639
numEntries += 2;
640640
return true;
641641
}
642642

643-
bool GotSection::addDynTlsEntry(Symbol &sym) {
643+
bool GotSection::addDynTlsEntry(const Symbol &sym) {
644644
assert(sym.auxIdx == symAux.size() - 1);
645645
symAux.back().tlsGdIdx = numEntries;
646646
// Global Dynamic TLS entries take two GOT slots.

lld/ELF/SyntheticSections.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ class GotSection final : public SyntheticSection {
106106
void writeTo(uint8_t *buf) override;
107107

108108
void addConstant(const Relocation &r);
109-
void addEntry(Symbol &sym);
110-
bool addTlsDescEntry(Symbol &sym);
111-
bool addDynTlsEntry(Symbol &sym);
109+
void addEntry(const Symbol &sym);
110+
bool addTlsDescEntry(const Symbol &sym);
111+
bool addDynTlsEntry(const Symbol &sym);
112112
bool addTlsIndex();
113113
uint32_t getTlsDescOffset(const Symbol &sym) const;
114114
uint64_t getTlsDescAddr(const Symbol &sym) const;

0 commit comments

Comments
 (0)