1
1
mirror of https://github.com/rui314/mold.git synced 2025-01-07 18:02:15 +03:00
This commit is contained in:
Rui Ueyama 2021-01-28 13:28:45 +09:00
parent 6a5ce0bc07
commit 754eb455bf

10
icf.cc
View File

@ -169,14 +169,13 @@ static void gather_sections(std::vector<Digest> &digests,
InputSection &isec = *sections[i];
for (i64 j = 0; j < isec.rels.size(); j++) {
if (isec.has_fragments[j])
continue;
if (!isec.has_fragments[j]) {
ElfRela &rel = isec.rels[j];
Symbol &sym = *isec.file->symbols[rel.r_sym];
if (!sym.fragref.frag && sym.input_section)
num_edges[i]++;
}
}
});
edge_indices.resize(num_edges.size());
@ -190,9 +189,7 @@ static void gather_sections(std::vector<Digest> &digests,
i64 idx = edge_indices[i];
for (i64 j = 0; j < isec.rels.size(); j++) {
if (isec.has_fragments[j])
continue;
if (!isec.has_fragments[j]) {
ElfRela &rel = isec.rels[j];
Symbol &sym = *isec.file->symbols[rel.r_sym];
@ -201,6 +198,7 @@ static void gather_sections(std::vector<Digest> &digests,
edges[idx++] = sym.input_section->icf_idx;
}
}
}
});
}