diff options
author | David Carlton <carlton@bactrian.org> | 2002-12-23 19:39:59 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2002-12-23 19:39:59 +0000 |
commit | a255c93707c1325ab30ea467c92a3c08c51fc1eb (patch) | |
tree | 95ec6f713582b2e627409dbe77b6d52dd4e58147 /gdb/solib-svr4.c | |
parent | d268a3f5e55a74606bbb15efd9418d9ca0055bc0 (diff) | |
download | gdb-a255c93707c1325ab30ea467c92a3c08c51fc1eb.zip gdb-a255c93707c1325ab30ea467c92a3c08c51fc1eb.tar.gz gdb-a255c93707c1325ab30ea467c92a3c08c51fc1eb.tar.bz2 |
2002-12-23 David Carlton <carlton@math.stanford.edu>
* Merge from mainline; tag is carlton_dictionary-20021223-merge.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r-- | gdb/solib-svr4.c | 21 |
1 files changed, 18 insertions, 3 deletions
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); + } } } |