mirror of
https://github.com/rui314/mold.git
synced 2024-09-22 10:27:48 +03:00
temporary
This commit is contained in:
parent
aece9bd436
commit
0be42acf12
25
main.cc
25
main.cc
@ -255,16 +255,6 @@ static void bin_sections() {
|
||||
|
||||
static void check_duplicate_symbols() {
|
||||
Timer t("check_undef_syms");
|
||||
|
||||
auto is_error = [](ObjectFile *file, int i) {
|
||||
const ElfSym &esym = file->elf_syms[i];
|
||||
Symbol &sym = *file->symbols[i];
|
||||
bool is_weak = (esym.st_bind == STB_WEAK);
|
||||
bool is_eliminated =
|
||||
!esym.is_abs() && !esym.is_common() && !file->sections[esym.st_shndx];
|
||||
return esym.is_defined() && !is_weak && !is_eliminated && sym.file != file;
|
||||
};
|
||||
|
||||
std::atomic_bool has_error = false;
|
||||
|
||||
tbb::parallel_for_each(out::objs, [&](ObjectFile *file) {
|
||||
@ -279,21 +269,18 @@ static void check_duplicate_symbols() {
|
||||
!esym.is_abs() && !esym.is_common() && !file->sections[esym.st_shndx];
|
||||
|
||||
if (esym.is_defined() && !is_weak && !is_eliminated && sym.file != file) {
|
||||
std::cerr << "duplicate symbol: " << *file << ": " << *sym.file << ": "
|
||||
<< sym.name << "\n";
|
||||
has_error = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (ObjectFile *file : out::objs)
|
||||
for (int i = file->first_global; i < file->elf_syms.size(); i++)
|
||||
if (is_error(file, i))
|
||||
std::cerr << "duplicate symbol: " << *file
|
||||
<< ": " << *file->symbols[i]->file << ": "
|
||||
<< file->symbols[i]->name << "\n";
|
||||
|
||||
if (has_error)
|
||||
if (has_error) {
|
||||
for (ObjectFile *file : out::objs)
|
||||
std::cerr << file->err_out.str();
|
||||
_exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
static void set_isec_offsets() {
|
||||
|
Loading…
Reference in New Issue
Block a user