From 8deb326648f33ab7e35c1c8b6e4e8f11dd805059 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 29 Oct 2020 19:13:46 +0900 Subject: [PATCH] temporary --- input_sections.cc | 4 +++- main.cc | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/input_sections.cc b/input_sections.cc index bf56f6c5..db6926ae 100644 --- a/input_sections.cc +++ b/input_sections.cc @@ -32,7 +32,7 @@ std::tuple InputSection::scan_relocations() { for (const ELF64LE::Rela &rel : rels) { Symbol *sym = file->get_symbol(rel.getSymbol(false)); - if (!sym) + if (!sym || !sym->file) continue; switch (rel.getType(false)) { @@ -48,10 +48,12 @@ std::tuple InputSection::scan_relocations() { case R_X86_64_REX_GOTPCRELX: num_got += !sym->needs_got.exchange(true); break; +#if 0 case R_X86_64_PLT32: num_got += !sym->needs_got.exchange(true); num_plt += !sym->needs_plt.exchange(true); break; +#endif } } diff --git a/main.cc b/main.cc index 8dd8a3a7..8734b929 100644 --- a/main.cc +++ b/main.cc @@ -375,7 +375,7 @@ private: }; int main(int argc, char **argv) { - tbb::global_control tbb_cont(tbb::global_control::max_allowed_parallelism, 64); + tbb::global_control tbb_cont(tbb::global_control::max_allowed_parallelism, 1); // Parse command line options MyOptTable opt_table; @@ -506,11 +506,13 @@ int main(int argc, char **argv) { for (Symbol *sym : file->symbols) { if (sym->file == file && sym->needs_got) { out::got->symbols.push_back(sym); - sym->got_addr = offset * 8; + sym->got_addr = offset; offset += 8; } } } + + assert(offset == out::got->size); } // Add output sections.