This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] OSF/1 - "next" over prologueless function call
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Joel Brobecker <brobecker at gnat dot com>, gdb-patches at sources dot redhat dot com
- Date: Tue, 2 Dec 2003 08:55:16 -0500
- Subject: Re: [RFA] OSF/1 - "next" over prologueless function call
- References: <20031202042646.GW1186@gnat.com> <20031202063532.GC31561@redhat.com>
On Mon, Dec 01, 2003 at 10:35:32PM -0800, Richard Henderson wrote:
> On Mon, Dec 01, 2003 at 08:26:46PM -0800, Joel Brobecker wrote:
> > + if (pc == func_start)
> > + return 1;
> > +
> > + if (pc == func_start + 8)
> > + {
> > + unsigned int inst;
> > +
> > + /* ldah $gp,n($t12) */
> > + inst = alpha_read_insn (func_start);
> > + if ((inst & 0xffff0000) != 0x27bb0000)
> > + return 0;
> > +
> > + /* lda $gp,n($gp) */
> > + inst = alpha_read_insn (func_start + 4);
> > + if ((inst & 0xffff0000) != 0x23bd0000)
> > + return 0;
>
> Is there any chance we could get hold of the symbol associated with
> this function start? On ELF detecting this condition can be
> streamlined to
>
> sym->st_other & STO_ALPHA_STD_GPLOAD == STO_ALPHA_STD_GPLOAD
>
> or from bfd, elf_link_hash_entry.other, though I don't remember off
> the top of my head how to get at the elf hash entry from asymbol.
I don't think you can. They're not added to a link hash table unless
you're actually linking.
It looks like there's no way to go from the asymbol to the ELF symbol
either, and st_other isn't stashed anywhere.
> And yes indeed, the gnu tools do this same optimization. Both at
> compile time and link time.
>
>
> r~
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer