File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -667,14 +667,15 @@ GotSection::GotSection(Ctx &ctx)
667667void GotSection::addConstant (const Relocation &r) { relocations.push_back (r); }
668668void GotSection::addEntry (const Symbol &sym) {
669669 assert (sym.auxIdx == ctx.symAux .size () - 1 );
670- if (auto *d = dyn_cast<Defined>(&sym)) {
670+ auto *d = dyn_cast<Defined>(&sym);
671+ if (d && ctx.arg .icf != ICFLevel::None) {
671672 // There may be symbols that have been ICFed in which case d->section
672673 // points to their canonical section and d->value is offset in to that section.
673674 // We add only a single GOT entry for all such symbols.
674675 auto [it, inserted] = gotEntries.insert (
675676 std::make_pair (std::make_pair (d->section , d->value ),
676677 numEntries));
677- if (!inserted) {
678+ if (!inserted && d-> folded ) {
678679 ctx.symAux .back ().gotIdx = it->getSecond ();
679680 return ;
680681 }
You can’t perform that action at this time.
0 commit comments