From: kettenis Date: Fri, 28 Oct 2022 15:09:39 +0000 (+0000) Subject: Add DT_MIPS_RLD_MAP_REL support to the in-tree GDB. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=925c301e87d2de7d3782bf136950a4be4334d3b7;p=openbsd Add DT_MIPS_RLD_MAP_REL support to the in-tree GDB. ok deraadt@ --- diff --git a/gnu/usr.bin/binutils/gdb/solib-svr4.c b/gnu/usr.bin/binutils/gdb/solib-svr4.c index 4a961e3fafb..83a761c55e4 100644 --- a/gnu/usr.bin/binutils/gdb/solib-svr4.c +++ b/gnu/usr.bin/binutils/gdb/solib-svr4.c @@ -395,7 +395,8 @@ elf_locate_base (void) (bfd_byte *) x_dynp->d_un.d_ptr); return dyn_ptr; } - else if (dyn_tag == DT_MIPS_RLD_MAP) + else if (dyn_tag == DT_MIPS_RLD_MAP || + dyn_tag == DT_MIPS_RLD_MAP_REL) { char *pbuf; int pbuf_size = TARGET_PTR_BIT / HOST_CHAR_BIT; @@ -405,6 +406,8 @@ elf_locate_base (void) of the dynamic link structure. */ dyn_ptr = bfd_h_get_64 (exec_bfd, (bfd_byte *) x_dynp->d_un.d_ptr); + if (dyn_tag == DT_MIPS_RLD_MAP_REL) + dyn_ptr += (entry_addr - bfd_get_start_address(exec_bfd)); if (target_read_memory (dyn_ptr, pbuf, pbuf_size)) return 0; return extract_unsigned_integer (pbuf, pbuf_size); diff --git a/gnu/usr.bin/binutils/include/elf/mips.h b/gnu/usr.bin/binutils/include/elf/mips.h index ce43158123f..eecd6d59c04 100644 --- a/gnu/usr.bin/binutils/include/elf/mips.h +++ b/gnu/usr.bin/binutils/include/elf/mips.h @@ -632,6 +632,9 @@ extern void bfd_mips_elf32_swap_reginfo_out /* Address of auxiliary .dynamic. */ #define DT_MIPS_AUX_DYNAMIC 0x70000031 + +/* Relative address of run time loader map, used for debugging. */ +#define DT_MIPS_RLD_MAP_REL 0x70000035 /* Flags which may appear in a DT_MIPS_FLAGS entry. */