1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-21 09:57:18 +03:00

Fix --relocatable

This commit is contained in:
Rui Ueyama 2021-06-13 16:17:04 +09:00
parent 4f31c22fac
commit 10993a3251

View File

@ -174,8 +174,11 @@ void RSymtabSection<E>::add_global_symbol(Context<E> &ctx, RObjectFile<E> &file,
return;
}
// TODO
file.symidx[idx] = it->second;
ElfSym<E> &existing = syms[it->second];
if (existing.is_undef() && !sym.is_undef())
existing = sym;
}
template <typename E>
@ -467,7 +470,7 @@ void combine_objects(Context<E> &ctx, std::span<std::string_view> file_args) {
for (i64 i = 1; i < file->first_global; i++)
symtab.add_local_symbol(ctx, *file, i);
symtab.out_shdr.sh_info = symtab.syms.size() + 1;
symtab.out_shdr.sh_info = symtab.syms.size();
for (std::unique_ptr<RObjectFile<E>> &file : files)
for (i64 i = file->first_global; i < file->syms.size(); i++)