From 9cbb74faa1de47e829507bc7fc2c99d9b5dad615 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 25 Nov 2020 14:06:13 +0900 Subject: [PATCH] temporary --- input_sections.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/input_sections.cc b/input_sections.cc index b1aa1a2f..1e91542c 100644 --- a/input_sections.cc +++ b/input_sections.cc @@ -105,6 +105,7 @@ void InputSection::copy_buf() { 0x64, 0x48, 0x8b, 0x04, 0x25, 0, 0, 0, 0, // mov %fs:0, %rax }; memcpy(loc - 3, insn, sizeof(insn)); + i++; } else { *(u32 *)loc = sym.get_tlsld_addr() + A - P; } @@ -177,8 +178,11 @@ void InputSection::scan_relocations() { i++; break; case R_X86_64_TLSLD: + assert(rels[i + 1].getType(false) == R_X86_64_PLT32); if (sym.is_imported) sym.flags |= Symbol::NEEDS_TLSLD; + else + i++; break; case R_X86_64_GOTTPOFF: sym.flags |= Symbol::NEEDS_GOTTPOFF;