@@ -97,7 +97,7 @@ static std::string getLocation(Ctx &ctx, InputSectionBase &s, const Symbol &sym,
97
97
return msg + s.getObjMsg (off);
98
98
}
99
99
100
- void elf::reportRangeError (Ctx &, uint8_t *loc, const Relocation &rel,
100
+ void elf::reportRangeError (Ctx &ctx , uint8_t *loc, const Relocation &rel,
101
101
const Twine &v, int64_t min, uint64_t max) {
102
102
ErrorPlace errPlace = getErrorPlace (ctx, loc);
103
103
std::string hint;
@@ -600,7 +600,7 @@ static bool canSuggestExternCForCXX(StringRef ref, StringRef def) {
600
600
// Suggest an alternative spelling of an "undefined symbol" diagnostic. Returns
601
601
// the suggested symbol, which is either in the symbol table, or in the same
602
602
// file of sym.
603
- static const Symbol *getAlternativeSpelling (const Undefined &sym,
603
+ static const Symbol *getAlternativeSpelling (Ctx &ctx, const Undefined &sym,
604
604
std::string &pre_hint,
605
605
std::string &post_hint) {
606
606
DenseMap<StringRef, const Symbol *> map;
@@ -777,7 +777,7 @@ static void reportUndefinedSymbol(Ctx &ctx, const UndefinedDiag &undef,
777
777
if (correctSpelling) {
778
778
std::string pre_hint = " : " , post_hint;
779
779
if (const Symbol *corrected =
780
- getAlternativeSpelling (sym, pre_hint, post_hint)) {
780
+ getAlternativeSpelling (ctx, sym, pre_hint, post_hint)) {
781
781
msg += " \n >>> did you mean" + pre_hint + toString (*corrected) + post_hint;
782
782
if (corrected->file )
783
783
msg += " \n >>> defined in: " + toString (corrected->file );
@@ -875,9 +875,9 @@ RelType RelocationScanner::getMipsN32RelType(RelTy *&rel) const {
875
875
}
876
876
877
877
template <bool shard = false >
878
- static void addRelativeReloc (InputSectionBase &isec, uint64_t offsetInSec ,
879
- Symbol &sym, int64_t addend, RelExpr expr ,
880
- RelType type) {
878
+ static void addRelativeReloc (Ctx &ctx, InputSectionBase &isec ,
879
+ uint64_t offsetInSec, Symbol &sym, int64_t addend,
880
+ RelExpr expr, RelType type) {
881
881
Partition &part = isec.getPartition ();
882
882
883
883
if (sym.isTagged ()) {
@@ -944,7 +944,8 @@ void elf::addGotEntry(Ctx &ctx, Symbol &sym) {
944
944
if (!ctx.arg .isPic || isAbsolute (sym))
945
945
ctx.in .got ->addConstant ({R_ABS, ctx.target ->symbolicRel , off, 0 , &sym});
946
946
else
947
- addRelativeReloc (*ctx.in .got , off, sym, 0 , R_ABS, ctx.target ->symbolicRel );
947
+ addRelativeReloc (ctx, *ctx.in .got , off, sym, 0 , R_ABS,
948
+ ctx.target ->symbolicRel );
948
949
}
949
950
950
951
static void addTpOffsetGotEntry (Ctx &ctx, Symbol &sym) {
@@ -1151,7 +1152,7 @@ void RelocationScanner::processAux(RelExpr expr, RelType type, uint64_t offset,
1151
1152
RelType rel = ctx.target ->getDynRel (type);
1152
1153
if (oneof<R_GOT, R_LOONGARCH_GOT>(expr) ||
1153
1154
(rel == ctx.target ->symbolicRel && !sym.isPreemptible )) {
1154
- addRelativeReloc<true >(*sec, offset, sym, addend, expr, type);
1155
+ addRelativeReloc<true >(ctx, *sec, offset, sym, addend, expr, type);
1155
1156
return ;
1156
1157
}
1157
1158
if (rel != 0 ) {
@@ -1437,7 +1438,7 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1437
1438
// R_GOT needs a relative relocation for PIC on i386 and Hexagon.
1438
1439
if (expr == R_GOT && ctx.arg .isPic &&
1439
1440
!ctx.target ->usesOnlyLowPageBits (type))
1440
- addRelativeReloc<true >(*sec, offset, sym, addend, expr, type);
1441
+ addRelativeReloc<true >(ctx, *sec, offset, sym, addend, expr, type);
1441
1442
else
1442
1443
sec->addReloc ({expr, type, offset, addend, &sym});
1443
1444
}
0 commit comments