From fecd09d0550dbcecc695a5c826f686660001f20f Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 30 Oct 2020 17:59:45 +0900 Subject: [PATCH] temporary --- input_sections.cc | 4 ++-- main.cc | 4 ++-- mold.h | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/input_sections.cc b/input_sections.cc index af68f7ad..078d2e65 100644 --- a/input_sections.cc +++ b/input_sections.cc @@ -68,7 +68,7 @@ void InputSection::relocate(u8 *buf) { Symbol *sym = file->get_symbol(sym_idx); u8 *loc = buf + output_section->shdr.sh_offset + offset + rel.r_offset; - u64 G = sym ? sym->got_addr : 0; + u64 G = sym ? sym->got_offset : 0; u64 GOT = out::got->shdr.sh_addr; u64 S = sym ? sym->addr : file->get_symbol_addr(sym_idx); i64 A = rel.r_addend; @@ -113,7 +113,7 @@ void InputSection::relocate(u8 *buf) { case R_X86_64_DTPOFF32: break; case R_X86_64_GOTTPOFF: - *(u32 *)loc = (sym ? sym->gottp_addr : 0) + GOT + A - P; + *(u32 *)loc = (sym ? sym->gottp_offset : 0) + GOT + A - P; break; case R_X86_64_TPOFF32: *(u32 *)loc = S - out::tls_end; diff --git a/main.cc b/main.cc index eeb6bcef..8daa0844 100644 --- a/main.cc +++ b/main.cc @@ -532,11 +532,11 @@ int main(int argc, char **argv) { if (sym->needs_got) { out::got->symbols.push_back({GotSection::REGULAR, sym}); - sym->got_addr = offset; + sym->got_offset = offset; offset += 8; } else if (sym->needs_gottp) { out::got->symbols.push_back({GotSection::TP, sym}); - sym->gottp_addr = offset; + sym->gottp_offset = offset; offset += 8; } } diff --git a/mold.h b/mold.h index 57f32aeb..094bbfc8 100644 --- a/mold.h +++ b/mold.h @@ -185,11 +185,12 @@ public: InputSection *input_section = nullptr; u64 addr = 0; - u64 got_addr = 0; - u64 gottp_addr = 0; - u64 plt_addr = 0; - u64 value; + + u32 got_offset = 0; + u32 gottp_offset = 0; + u32 plt_offset = 0; + u8 visibility = 0; bool is_weak = false; bool is_undef_weak = false;