2 * Copyright (c) 1983 Regents of the University of California.
5 * Redistribution and use in source and binary forms are permitted
6 * provided that: (1) source distributions retain this entire copyright
7 * notice and comment, and (2) distributions including binaries display
8 * the following acknowledgement: ``This product includes software
9 * developed by the University of California, Berkeley and its contributors''
10 * in the documentation or other materials provided with the distribution
11 * and in all advertising materials mentioning features or use of this
12 * software. Neither the name of the University nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27 DEFUN (iscall, (ip), unsigned char *ip)
29 if (*ip == 0xeb || *ip == 0x9a)
36 find_call (parent, p_lowpc, p_highpc)
41 unsigned char *instructp;
46 if (core_text_space == 0)
50 if (p_lowpc < s_lowpc)
54 if (p_highpc > s_highpc)
58 DBG (CALLDEBUG, printf ("[findcall] %s: 0x%lx to 0x%lx\n",
59 parent->name, p_lowpc, p_highpc));
60 for (instructp = (unsigned char *) core_text_space + p_lowpc;
61 instructp < (unsigned char *) core_text_space + p_highpc;
65 if (iscall (instructp))
68 printf ("[findcall]\t0x%x:callf",
69 instructp - (unsigned char *) core_text_space));
72 * regular pc relative addressing
73 * check that this is the address of
76 destpc = ((bfd_vma) instructp + 5 - (bfd_vma) core_text_space);
77 if (destpc >= s_lowpc && destpc <= s_highpc)
79 child = sym_lookup (&symtab, destpc);
81 printf ("[findcall]\tdestpc 0x%lx", destpc);
82 printf (" child->name %s", child->name);
83 printf (" child->addr 0x%lx\n", child->addr);
85 if (child->addr == destpc)
90 arc_add (parent, child, (long) 0);
91 length += 4; /* constant lengths */
98 * it looked like a callf,
99 * but it wasn't to anywhere.
103 * something funny going on.
105 DBG (CALLDEBUG, printf ("[findcall]\tbut it's a botch\n"));