1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-05 09:07:10 +03:00
This commit is contained in:
Rui Ueyama 2022-04-30 16:19:47 +08:00
parent af592f303c
commit c1c20aa427
3 changed files with 7 additions and 14 deletions

View File

@ -96,19 +96,18 @@ std::vector<GdbIndexName> read_pubnames(Context<E> &ctx, ObjectFile<E> &file) {
// Uniquify elements because GCC 11 seems to emit one record for each
// comdat group which results in having a lot of duplicate records.
std::sort(vec.begin(), vec.end(),
[](const GdbIndexName &a, const GdbIndexName &b) {
auto less = [](const GdbIndexName &a, const GdbIndexName &b) {
return std::tuple{a.hash, a.attr, a.name} <
std::tuple{b.hash, b.attr, b.name};
});
};
auto last = std::unique(vec.begin(), vec.end(),
[](const GdbIndexName &a, const GdbIndexName &b) {
auto equal = [](const GdbIndexName &a, const GdbIndexName &b) {
return std::tuple{a.hash, a.attr, a.name} ==
std::tuple{b.hash, b.attr, b.name};
});
};
vec.erase(last, vec.end());
std::sort(vec.begin(), vec.end(), less);
vec.erase(std::unique(vec.begin(), vec.end(), equal), vec.end());
return vec;
}

View File

@ -493,7 +493,7 @@ void ObjectFile<E>::sort_relocations(Context<E> &ctx) {
sorted_rels.resize(sections.size());
for (i64 i = 1; i < sections.size(); i++) {
std::unique_ptr<InputSection<E>> &isec = sections[i];;
std::unique_ptr<InputSection<E>> &isec = sections[i];
if (!isec || !isec->is_alive || !(isec->shdr().sh_flags & SHF_ALLOC))
continue;

6
mold.h
View File

@ -375,12 +375,6 @@ private:
static constexpr const char *marker = "marker";
};
//
// threads.cc
//
void set_thread_count(i64 n);
//
// hyperloglog.cc
//