1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-26 01:44:29 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-08 18:20:48 +09:00
parent ac9d4cd6e4
commit 23e874eb50
2 changed files with 3 additions and 7 deletions

2
mold.h
View File

@ -620,7 +620,7 @@ private:
void write_symtab(u8 *buf, u64 symtab_off, u64 strtab_off, u32 start, u32 end);
MemoryBufferRef mb;
std::vector<std::pair<ComdatGroup *, u32>> comdat_groups;
std::vector<std::pair<ComdatGroup *, ArrayRef<ELF64LE::Word>>> comdat_groups;
std::vector<Symbol> local_symbols;
std::vector<StringPieceRef> sym_pieces;

View File

@ -51,7 +51,7 @@ void ObjectFile::initialize_sections() {
static ConcurrentMap<ComdatGroup> map;
ComdatGroup *group = map.insert(signature, ComdatGroup(nullptr, 0));
comdat_groups.push_back({group, i});
comdat_groups.push_back({group, entries});
static Counter counter("comdats");
counter.inc();
@ -413,14 +413,10 @@ void ObjectFile::resolve_comdat_groups() {
void ObjectFile::eliminate_duplicate_comdat_groups() {
for (auto &pair : comdat_groups) {
ComdatGroup *group = pair.first;
u32 section_idx = pair.second;
if (group->file == this)
continue;
const ELF64LE::Shdr &shdr = elf_sections[section_idx];
ArrayRef<ELF64LE::Word> entries =
CHECK(obj.template getSectionContentsAsArray<ELF64LE::Word>(shdr), this);
ArrayRef<ELF64LE::Word> entries = pair.second;
for (u32 i : entries)
sections[i] = nullptr;
}