diff --git a/core/elf.cc b/core/elf.cc index ecb479c9d32e58726bcd7c866590705dfc949e30..502484390c85a2a77a00e3a66d7001c37cbe42cb 100644 --- a/core/elf.cc +++ b/core/elf.cc @@ -924,6 +924,9 @@ init_table get_init(Elf64_Ehdr* header) // FIXME: assumes TLS segment comes before DYNAMIC segment *static_cast<u64*>(addr) = lookup()->st_value - ret.tls.size; break; + case R_X86_64_IRELATIVE: + *static_cast<void**>(addr) = reinterpret_cast<void *(*)()>(base + addend)(); + break; default: abort(); } diff --git a/include/elf.hh b/include/elf.hh index 43eb6e6adecd00a78b6b92ee26edd0ea59b0ee4d..b1419987927c39d663d0f8428ea2137f20bbd975 100644 --- a/include/elf.hh +++ b/include/elf.hh @@ -192,6 +192,7 @@ enum { R_X86_64_GOTPC32 = 26, // word32 GOT + A - P R_X86_64_SIZE32 = 32, // word32 Z + A R_X86_64_SIZE64 = 33, // word64 Z + A + R_X86_64_IRELATIVE = 37, // word64 indirect(B + A) }; enum {