Skip to content

Commit

Permalink
[NFC][lld] Pass sym as const reference to GotSection's methods (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kovdan01 committed Mar 25, 2024
1 parent ea798a7 commit f3f594c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lld/ELF/SyntheticSections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,19 +628,19 @@ GotSection::GotSection()
}

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

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

bool GotSection::addDynTlsEntry(Symbol &sym) {
bool GotSection::addDynTlsEntry(const Symbol &sym) {
assert(sym.auxIdx == symAux.size() - 1);
symAux.back().tlsGdIdx = numEntries;
// Global Dynamic TLS entries take two GOT slots.
Expand Down
6 changes: 3 additions & 3 deletions lld/ELF/SyntheticSections.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ class GotSection final : public SyntheticSection {
void writeTo(uint8_t *buf) override;

void addConstant(const Relocation &r);
void addEntry(Symbol &sym);
bool addTlsDescEntry(Symbol &sym);
bool addDynTlsEntry(Symbol &sym);
void addEntry(const Symbol &sym);
bool addTlsDescEntry(const Symbol &sym);
bool addDynTlsEntry(const Symbol &sym);
bool addTlsIndex();
uint32_t getTlsDescOffset(const Symbol &sym) const;
uint64_t getTlsDescAddr(const Symbol &sym) const;
Expand Down

0 comments on commit f3f594c

Please sign in to comment.