gprof rejects egcs' global constructor calling functions
Ian Lance Taylor
ian@zembu.com
Thu May 25 11:04:00 GMT 2000
Date: Thu, 25 May 2000 19:30:34 +0200 (MET DST)
From: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>
> gprof is falsely rejecting the symbol name. The comment explains
> why. It is specific to a.out.
Hmmm... does that mean gcc would have chosen a different name
than _GLOBAL_.I.main on an a.out platform, to avoid producing
an illegal symbol, there? Or is a dot somewhere else in the
name legal on a.out, and gprof is just shooting blindly?
> That a.out specific test should be replaced with a call to
> bfd_is_local_label.
Hmm... that test doesn't do as much as the one in gprof/core.c, for a.out.
bfd_generic_is_local_label_name() only checks the first character. Doesn't
look to me as if they're really checking for the same thing.
You're right, I was somewhat wrong. gprof should be calling
local_label, but it may want to do some additional tests. The test
for a '.' is a.out specific, but it doesn't really care about a '.'.
It is trying to catch the `foo.o' N_SO symbols which appear in the
a.out symbol table. Maybe gprof should look for symbols ending in
`.o'.
gcc is fine in using a '.' in a symbol name on a.out.
BTW: there's another fishy test in gprof/core.c: it rejects the name
'__gnu_compiled'. The same test is also done in nm and objdump, for
similar reasons. Those also reject "__gcc2_compiled", but gprof/core.c
doesn't do that. It probably should. To me this looks like something to be
moved into the bfd_is_local_label() implementation, or a similarly central
place.
No, __gnu_compiled is not a local label in the sense of
bfd_is_local_label. We may want a different central function for
these.
Ian
More information about the Binutils
mailing list