diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2022-12-08 13:41:07 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2022-12-08 13:41:07 +0000 |
commit | e0ca09d77fa4daefbbb95a0bbb3713c761c7c901 (patch) | |
tree | 7c11d26e3ce86339c7de8c38034a3ced5f998789 /gnu/usr.bin/binutils | |
parent | b814aff3ffc936ae80d450b6d4ce4e6b164f389b (diff) |
Fix DT_MIPS_RLD_MAP_REL
Use proper tag-relative values for DT_MIPS_RLD_MAP_REL tags.
This causes an ABI break on mips64. Your system must have latest ld.so
before applying this commit.
OK deraadt@ kettenis@
Diffstat (limited to 'gnu/usr.bin/binutils')
-rw-r--r-- | gnu/usr.bin/binutils/gdb/solib-svr4.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils/gdb/solib-svr4.c b/gnu/usr.bin/binutils/gdb/solib-svr4.c index 83a761c55e4..63b0e17e13c 100644 --- a/gnu/usr.bin/binutils/gdb/solib-svr4.c +++ b/gnu/usr.bin/binutils/gdb/solib-svr4.c @@ -378,6 +378,8 @@ elf_locate_base (void) } else /* 64-bit elf */ { + char *bufstart = buf; + for (bufend = buf + dyninfo_sect_size; buf < bufend; buf += sizeof (Elf64_External_Dyn)) @@ -407,7 +409,7 @@ elf_locate_base (void) 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)); + dyn_ptr += (relocated_dyninfo_addr + (buf - bufstart)); if (target_read_memory (dyn_ptr, pbuf, pbuf_size)) return 0; return extract_unsigned_integer (pbuf, pbuf_size); |