From c7769d37664e833cbf6d746d325d9ce7d39ad915 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 13 Nov 2020 19:47:57 +0900 Subject: [PATCH] temporary --- input_sections.cc | 11 ++--------- main.cc | 4 ++-- mold.h | 5 +---- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/input_sections.cc b/input_sections.cc index 7ec15e94..eb3cfe96 100644 --- a/input_sections.cc +++ b/input_sections.cc @@ -131,12 +131,8 @@ void InputSection::scan_relocations() { sym->file->dynstr_size += sym->name.size() + 1; } - if (sym->type == STT_GNU_IFUNC && set_flag(sym, Symbol::NEEDS_IFUNC) && - set_flag(sym, Symbol::NEEDS_PLT)) { + if (sym->type == STT_GNU_IFUNC && set_flag(sym, Symbol::NEEDS_PLT)) sym->file->num_plt++; - sym->file->num_gotplt++; - sym->file->num_relplt++; - } switch (rel.getType(false)) { case R_X86_64_GOT32: @@ -158,11 +154,8 @@ void InputSection::scan_relocations() { case R_X86_64_PLT32: if (config.is_static) break; - if (set_flag(sym, Symbol::NEEDS_PLT)) { + if (set_flag(sym, Symbol::NEEDS_PLT)) sym->file->num_plt++; - sym->file->num_gotplt++; - sym->file->num_relplt++; - } break; } } diff --git a/main.cc b/main.cc index 57622507..0815d8f7 100644 --- a/main.cc +++ b/main.cc @@ -340,13 +340,13 @@ static void scan_rels(ArrayRef files) { out::got->shdr.sh_size += file->num_got * GOT_SIZE; file->gotplt_offset = out::gotplt->shdr.sh_size; - out::gotplt->shdr.sh_size += file->num_gotplt * GOT_SIZE; + out::gotplt->shdr.sh_size += file->num_plt * GOT_SIZE; file->plt_offset = out::plt->shdr.sh_size; out::plt->shdr.sh_size += file->num_plt * PLT_SIZE; file->relplt_offset = out::relplt->shdr.sh_size; - out::relplt->shdr.sh_size += file->num_relplt * sizeof(ELF64LE::Rela); + out::relplt->shdr.sh_size += file->num_plt * sizeof(ELF64LE::Rela); if (out::dynsym) { file->dynsym_offset = out::dynsym->shdr.sh_size; diff --git a/mold.h b/mold.h index bef3b502..2016c5cc 100644 --- a/mold.h +++ b/mold.h @@ -216,7 +216,6 @@ public: NEEDS_GOTTP = 1 << 1, NEEDS_PLT = 1 << 2, NEEDS_DYNSYM = 1 << 3, - NEEDS_IFUNC = 1 << 4, }; std::atomic_uint8_t flags = ATOMIC_VAR_INIT(0); @@ -589,10 +588,8 @@ public: u64 global_symtab_size = 0; u64 global_strtab_size = 0; - std::atomic_uint32_t num_plt = ATOMIC_VAR_INIT(0); std::atomic_uint32_t num_got = ATOMIC_VAR_INIT(0); - std::atomic_uint32_t num_gotplt = ATOMIC_VAR_INIT(0); - std::atomic_uint32_t num_relplt = ATOMIC_VAR_INIT(0); + std::atomic_uint32_t num_plt = ATOMIC_VAR_INIT(0); std::atomic_uint32_t num_dynsym = ATOMIC_VAR_INIT(0); std::atomic_uint32_t dynstr_size = ATOMIC_VAR_INIT(0);