Skip to content

Commit

Permalink
elfhacks: d_un.d_ptr is relative on mips glibc too
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Icenowy authored and flightlessmango committed Sep 5, 2024
1 parent d0894ff commit 4b45e26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/elfhacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4b45e26

Please sign in to comment.