diff options
author | Kevin Buettner <kevinb@redhat.com> | 2002-12-21 06:43:25 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2002-12-21 06:43:25 +0000 |
commit | 743b930b5935b474bec050a1598344b8580eaab9 (patch) | |
tree | e10b871160c93c0bdcc4d5817f44f7fca8a43305 /gdb | |
parent | 3758ac483ded1c0d72f079e32ad1de4fcabecdb5 (diff) | |
download | gdb-743b930b5935b474bec050a1598344b8580eaab9.zip gdb-743b930b5935b474bec050a1598344b8580eaab9.tar.gz gdb-743b930b5935b474bec050a1598344b8580eaab9.tar.bz2 |
Add DT_MIPS_RLD_MAP case for 64-bit targets.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/solib-svr4.c | 21 |
2 files changed, 23 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f0ce860..c3ab184 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2002-12-20 Kevin Buettner <kevinb@redhat.com> + * solib-svr4.c (elf_locate_base): Fix sizeof() related bug. Add + DT_MIPS_RLD_MAP case for 64-bit targets. + +2002-12-20 Kevin Buettner <kevinb@redhat.com> + * mips-tdep.c (heuristic_proc_desc): Clear memory associated with ``temp_saved_regs'', not the pointer or other storage contiguous to this pointer. diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 78161e0..8ced5f0 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -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); + } } } |