summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2005-04-29 21:48:28 +0000
committerKevin Buettner <kevinb@redhat.com>2005-04-29 21:48:28 +0000
commitb8d0b146f3af22987c51415b924d3157640c2c1c (patch)
treecac9e2f3757084f0f039330b3623926aa60ee1bc
parent601cfdbb216b6a0032260b6438c6a759779b4413 (diff)
downloadgdb-b8d0b146f3af22987c51415b924d3157640c2c1c.tar.gz
Fix bugs related to inferior function calls on FRV using the FDPIC ABI.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/frv-tdep.c7
-rw-r--r--gdb/solib-frv.c4
3 files changed, 18 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0759dc74a93..40ed5525722 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2005-04-29 Kevin Buettner <kevinb@redhat.com>
+
+ * frv-tdep.c (find_func_descr): Verify that entry point can be
+ found in symbol table prior to looking up its function descriptor.
+ * solib-frv.c (find_canonical_descriptor_in_load_object): Add
+ test for non-NULL link map.
+
2005-04-29 Corinna Vinschen <vinschen@redhat.com>
* MAINTAINERS: Revert h8300 state to un-deleted.
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 20b4427c9c3..e597037b912 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -1079,6 +1079,13 @@ find_func_descr (struct gdbarch *gdbarch, CORE_ADDR entry_point)
{
CORE_ADDR descr;
char valbuf[4];
+ CORE_ADDR start_addr;
+
+ /* If we can't find the function in the symbol table, then we assume
+ that the function address is already in descriptor form. */
+ if (!find_pc_partial_function (entry_point, NULL, &start_addr, NULL)
+ || entry_point != start_addr)
+ return entry_point;
descr = frv_fdpic_find_canonical_descriptor (entry_point);
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index ecc791a3379..4647b955c5e 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -1109,6 +1109,10 @@ find_canonical_descriptor_in_load_object
if (abfd == 0)
return 0;
+ /* Nothing to do if no link map. */
+ if (lm == 0)
+ return 0;
+
/* We want to scan the dynamic relocs for R_FRV_FUNCDESC relocations.
(More about this later.) But in order to fetch the relocs, we
need to first fetch the dynamic symbols. These symbols need to