aboutsummaryrefslogtreecommitdiff
path: root/gdb/hppa-tdep.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-04-06 00:56:36 +0000
committerJeff Law <law@redhat.com>1994-04-06 00:56:36 +0000
commit4f9159141072fd265ad28b800df492cd7977d506 (patch)
treedf84627ba9119ac6ec728c5995335f9ffcbfee98 /gdb/hppa-tdep.c
parent117dbbc60929a7b08250e1306c8988a34991151b (diff)
downloadfsf-binutils-gdb-4f9159141072fd265ad28b800df492cd7977d506.zip
fsf-binutils-gdb-4f9159141072fd265ad28b800df492cd7977d506.tar.gz
fsf-binutils-gdb-4f9159141072fd265ad28b800df492cd7977d506.tar.bz2
* hppa-tdep.c (hppa_fix_call_dummy): If FUN is a procedure label,
then gets its real address into FUN and its GOT/DP value into %r19. * tm-hppa.h (CALL_DUMMY): Use %r20, not %r19 as a temporary.
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r--gdb/hppa-tdep.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 7729fdf..fa44b12 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1074,6 +1074,20 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
dyncall_addr = SYMBOL_VALUE_ADDRESS (msymbol);
+ /* FUN could be a procedure label, in which case we have to get
+ its real address and the value of its GOT/DP. */
+ if (fun & 0x2)
+ {
+ /* Get the GOT/DP value for the target function. It's
+ at *(fun+4). Note the call dummy is *NOT* allowed to
+ trash %r19 before calling the target function. */
+ write_register (19, read_memory_integer ((fun & ~0x3) + 4, 4));
+
+ /* Now get the real address for the function we are calling, it's
+ at *fun. */
+ fun = (CORE_ADDR) read_memory_integer (fun & ~0x3, 4);
+ }
+
/* If we are calling an import stub (eg calling into a dynamic library)
then have sr4export call the magic __d_plt_call routine which is linked
in from end.o. (You can't use _sr4export to call the import stub as