summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/solib-svr4.c2
-rw-r--r--gdb/solib.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index a4fcb121486..98c8522ffd5 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -2973,7 +2973,7 @@ svr4_clear_solib (void)
static CORE_ADDR
svr4_truncate_ptr (CORE_ADDR addr)
{
- if (gdbarch_ptr_bit (target_gdbarch ()) == sizeof (CORE_ADDR) * 8)
+ if (gdbarch_ptr_bit (target_gdbarch ()) >= sizeof (CORE_ADDR) * 8)
/* We don't need to truncate anything, and the bit twiddling below
will fail due to overflow problems. */
return addr;
diff --git a/gdb/solib.c b/gdb/solib.c
index 8bcbfa22df1..adeb3a1a411 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1567,14 +1567,25 @@ gdb_bfd_scan_elf_dyntag (const int desired_dyntag, bfd *abfd, CORE_ADDR *ptr,
entry. */
if (ptr)
{
+#if 0
struct type *ptr_type;
+#else
+ enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
+#endif
gdb_byte ptr_buf[8];
CORE_ADDR ptr_addr_1;
+#if 0
ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
+#endif
ptr_addr_1 = dyn_addr + (buf - bufstart) + arch_size / 8;
if (target_read_memory (ptr_addr_1, ptr_buf, arch_size / 8) == 0)
+#if 0
dyn_ptr = extract_typed_address (ptr_buf, ptr_type);
+#else
+ dyn_ptr = extract_unsigned_integer (ptr_buf, arch_size / 8,
+ byte_order);
+#endif
*ptr = dyn_ptr;
if (ptr_addr)
*ptr_addr = dyn_addr + (buf - bufstart);