From c047f9f1d328042bdc3e5588f0bc675bd5e8db1d Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 15 Dec 2020 23:50:49 +0900 Subject: [PATCH] temporary --- input_sections.cc | 50 ++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/input_sections.cc b/input_sections.cc index 33e9563f..3682a611 100644 --- a/input_sections.cc +++ b/input_sections.cc @@ -164,35 +164,37 @@ void InputSection::scan_relocations() { break; case R_X86_64_32: case R_X86_64_32S: - case R_X86_64_64: - if (sym.is_imported) { - std::lock_guard lock(sym.mu); - if (sym.type == STT_OBJECT) { - sym.needs_copyrel = true; - rel_types[i] = R_ABS; - } else { - sym.needs_plt = true; - rel_types[i] = R_PLT; - } - } else { + case R_X86_64_64: { + if (!sym.is_imported) { rel_types[i] = R_ABS; + break; } - break; - case R_X86_64_PC32: - case R_X86_64_PC64: - if (sym.is_imported) { - std::lock_guard lock(sym.mu); - if (sym.type == STT_OBJECT) { - sym.needs_copyrel = true; - rel_types[i] = R_PC; - } else { - sym.needs_plt = true; - rel_types[i] = R_PLT; - } + std::lock_guard lock(sym.mu); + if (sym.type == STT_OBJECT) { + sym.needs_copyrel = true; + rel_types[i] = R_ABS; } else { - rel_types[i] = R_PC; + sym.needs_plt = true; + rel_types[i] = R_PLT; } break; + } + case R_X86_64_PC32: + case R_X86_64_PC64: { + if (!sym.is_imported) { + rel_types[i] = R_PC; + break; + } + std::lock_guard lock(sym.mu); + if (sym.type == STT_OBJECT) { + sym.needs_copyrel = true; + rel_types[i] = R_PC; + } else { + sym.needs_plt = true; + rel_types[i] = R_PLT; + } + break; + } case R_X86_64_GOT32:{ std::lock_guard lock(sym.mu); sym.needs_got = true;