Add DT_MIPS_RLD_MAP case for 64-bit targets.

This commit is contained in:
Kevin Buettner
2002-12-21 06:43:25 +00:00
parent 3758ac483d
commit 743b930b59
2 changed files with 23 additions and 3 deletions

View File

@ -446,15 +446,16 @@ elf_locate_base (void)
else if (dyn_tag == DT_MIPS_RLD_MAP)
{
char *pbuf;
int pbuf_size = TARGET_PTR_BIT / HOST_CHAR_BIT;
pbuf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
pbuf = alloca (pbuf_size);
/* DT_MIPS_RLD_MAP contains a pointer to the address
of the dynamic link structure. */
dyn_ptr = bfd_h_get_32 (exec_bfd,
(bfd_byte *) x_dynp->d_un.d_ptr);
if (target_read_memory (dyn_ptr, pbuf, sizeof (pbuf)))
if (target_read_memory (dyn_ptr, pbuf, pbuf_size))
return 0;
return extract_unsigned_integer (pbuf, sizeof (pbuf));
return extract_unsigned_integer (pbuf, pbuf_size);
}
}
}
@ -477,6 +478,20 @@ elf_locate_base (void)
(bfd_byte *) x_dynp->d_un.d_ptr);
return dyn_ptr;
}
else if (dyn_tag == DT_MIPS_RLD_MAP)
{
char *pbuf;
int pbuf_size = TARGET_PTR_BIT / HOST_CHAR_BIT;
pbuf = alloca (pbuf_size);
/* DT_MIPS_RLD_MAP contains a pointer to the address
of the dynamic link structure. */
dyn_ptr = bfd_h_get_64 (exec_bfd,
(bfd_byte *) x_dynp->d_un.d_ptr);
if (target_read_memory (dyn_ptr, pbuf, pbuf_size))
return 0;
return extract_unsigned_integer (pbuf, pbuf_size);
}
}
}