diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-10-28 15:09:40 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-10-28 15:09:40 +0000 |
commit | 3b8ec48636158ebfd9a3be88705ce48b0340f58e (patch) | |
tree | c2de868631fe1856fbe350dc8c68f34cf0bee929 /gnu/usr.bin/binutils | |
parent | 8841f89d635f19aa590de32596454f706e4698ba (diff) |
Add DT_MIPS_RLD_MAP_REL support to the in-tree GDB.
ok deraadt@
Diffstat (limited to 'gnu/usr.bin/binutils')
-rw-r--r-- | gnu/usr.bin/binutils/gdb/solib-svr4.c | 5 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/include/elf/mips.h | 3 |
2 files changed, 7 insertions, 1 deletions
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. */ |