Skip to content

Commit ba6973c

Browse files
committed
[ELF] Change nonnull pointer parameters to references
1 parent 12779ed commit ba6973c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lld/ELF/SyntheticSections.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,8 +1578,8 @@ void RelocationBaseSection::addSymbolReloc(RelType dynType,
15781578
uint64_t offsetInSec, Symbol &sym,
15791579
int64_t addend,
15801580
Optional<RelType> addendRelType) {
1581-
addReloc(DynamicReloc::AgainstSymbol, dynType, &isec, offsetInSec, sym,
1582-
addend, R_ADDEND, addendRelType ? *addendRelType : target->noneRel);
1581+
addReloc(DynamicReloc::AgainstSymbol, dynType, isec, offsetInSec, sym, addend,
1582+
R_ADDEND, addendRelType ? *addendRelType : target->noneRel);
15831583
}
15841584

15851585
void RelocationBaseSection::addRelativeReloc(
@@ -1591,8 +1591,8 @@ void RelocationBaseSection::addRelativeReloc(
15911591
assert((!sym.isPreemptible || expr == R_GOT) &&
15921592
"cannot add relative relocation against preemptible symbol");
15931593
assert(expr != R_ADDEND && "expected non-addend relocation expression");
1594-
addReloc(DynamicReloc::AddendOnlyWithTargetVA, dynType, &inputSec,
1595-
offsetInSec, sym, addend, expr, addendRelType);
1594+
addReloc(DynamicReloc::AddendOnlyWithTargetVA, dynType, inputSec, offsetInSec,
1595+
sym, addend, expr, addendRelType);
15961596
}
15971597

15981598
void RelocationBaseSection::addAddendOnlyRelocIfNonPreemptible(
@@ -1603,21 +1603,21 @@ void RelocationBaseSection::addAddendOnlyRelocIfNonPreemptible(
16031603
addReloc({dynType, &isec, offsetInSec, DynamicReloc::AgainstSymbol, sym, 0,
16041604
R_ABS});
16051605
else
1606-
addReloc(DynamicReloc::AddendOnlyWithTargetVA, dynType, &isec, offsetInSec,
1606+
addReloc(DynamicReloc::AddendOnlyWithTargetVA, dynType, isec, offsetInSec,
16071607
sym, 0, R_ABS, addendRelType);
16081608
}
16091609

16101610
void RelocationBaseSection::addReloc(DynamicReloc::Kind kind, RelType dynType,
1611-
InputSectionBase *inputSec,
1611+
InputSectionBase &inputSec,
16121612
uint64_t offsetInSec, Symbol &sym,
16131613
int64_t addend, RelExpr expr,
16141614
RelType addendRelType) {
16151615
// Write the addends to the relocated address if required. We skip
16161616
// it if the written value would be zero.
16171617
if (config->writeAddends && (expr != R_ADDEND || addend != 0))
1618-
inputSec->relocations.push_back(
1618+
inputSec.relocations.push_back(
16191619
{expr, addendRelType, offsetInSec, addend, &sym});
1620-
addReloc({dynType, inputSec, offsetInSec, kind, sym, addend, expr});
1620+
addReloc({dynType, &inputSec, offsetInSec, kind, sym, addend, expr});
16211621
}
16221622

16231623
void RelocationBaseSection::addReloc(const DynamicReloc &reloc) {

lld/ELF/SyntheticSections.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ class RelocationBaseSection : public SyntheticSection {
534534
uint64_t offsetInSec, Symbol &sym,
535535
RelType addendRelType);
536536
void addReloc(DynamicReloc::Kind kind, RelType dynType,
537-
InputSectionBase *inputSec, uint64_t offsetInSec, Symbol &sym,
537+
InputSectionBase &inputSec, uint64_t offsetInSec, Symbol &sym,
538538
int64_t addend, RelExpr expr, RelType addendRelType);
539539
bool isNeeded() const override { return !relocs.empty(); }
540540
size_t getSize() const override { return relocs.size() * this->entsize; }

0 commit comments

Comments
 (0)