This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: fake symbols to aid debugging
On Tue, Jul 29, 2003 at 07:45:30AM +0100, Nick Clifton wrote:
> Hi Alan,
>
> > I waste enough time doing this that I figure it's worth doing something
> > about it. My first idea, already implemented, was to have the linker
> > emit extra symbols to identify the stubs. This works well but bloats
> > the symbol table and isn't on by default. A better idea would be to
> > create the stub symbols on the fly. With that in mind, I propose to
> > add two new bfd functions
> >
> > long bfd_get_fake_symtab_upper_bound (bfd *abfd);
> > long bfd_canonicalize_fake_symtab (bfd *abfd, asymbol **buf);
> >
> > analogous to bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
> >
> > Comments?
>
> Well a few questions actually:
>
> Where would these fake symbols be held ? In a new .fakesymtab
> section? Or are they entirely ephemeral and never stored in the
> executable ?
They're ephemeral, but I discovered I needed to save some info away in
order to locate stubs. For that reason, I think the idea of emitting
DWARF2 info for stubs is better. Helps gdb out in tracing over stubs
too.
> Can the fake symbols be generated after the stubs are created ? ie
> can they be created for already existing libraries/executables ?
That was my aim, but short of scanning all code it's hard to locate
stubs..
> Would gdb users be able to set breakpoints on these fake symbols ?
I think so. It's a while since I poked around in gbd though..
--
Alan Modra
IBM OzLabs - Linux Technology Centre