From 4b45e2612f649ffb23feec401f5ebb8d293a84d7 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Thu, 5 Sep 2024 16:24:13 +0800 Subject: [PATCH] elfhacks: d_un.d_ptr is relative on mips glibc too In GLIBC, this behavior is controlled by per-architecture definition DL_RO_DYN_SECTION, which is only set to 1 on MIPS (according to the comments, it's because of requirements of MIPS ABI) and RISC-V (which seems to be a left-over of copying MIPS code, and kept because of compatibility to older GLIBC versions). Signed-off-by: Icenowy Zheng --- src/elfhacks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elfhacks.cpp b/src/elfhacks.cpp index 230b21676c..67da329927 100644 --- a/src/elfhacks.cpp +++ b/src/elfhacks.cpp @@ -29,7 +29,7 @@ * \{ */ -#if defined(__GLIBC__) && !defined(__riscv) +#if defined(__GLIBC__) && !(defined(__riscv) || defined(__mips__)) # define ABS_ADDR(obj, ptr) (ptr) #else # define ABS_ADDR(obj, ptr) ((obj->addr) + (ptr))