Re: [RFA] minsyms.c: Fix switching to GNU v3 ABI

Jim Blandy
2004-03-28T18:28:38Z

Corinna Vinschen <vinschen@redhat.com> writes:
> On Mar 25 15:44, Jim Blandy wrote:
> > One comment: I notice that we actually remove the leading character
> > earlier in prim_record_minimal_symbol_and_info, to check if the name
> > is the same as that of the GCC compilation marker symbol. It would be
> > nicer if we could just remove the leading character once, at the top
> > of the function, and then simplify the the "__gnu_compiled" test.
> > Doing so shouldn't interfere with the GCC_COMPILED_FLAG_SYMBOL tests,
> > since the code already presumes those both start with 'g'.
>
> Well, it could interfere. Assuming that leading char is the underscore.
> The first test would now find "gcc_compiled.", but not "_gcc_compiled.".
> When skipping the leading char before testing, the same test would now
> also find "_gcc_compiled.". If that's ok, I don't have a problem to
> change it as you like. Otherwise, I'd propose the below patch, which
> avoids that problem.

Sure, this looks good; it leaves the current behavior unchanged.
Please commit.

I'm kind of amazed that some of the GCC compilation symbols get
prefixed, while others don't. That exact arrangement --- where
GCC_COMPILED_FLAG_SYMBOL and GCC2_COMPILED_FLAG_SYMBOL are tested
before stripping the leading char, and __gnu_compiled is tested after
stripping --- originated in 1993 in dbxread.c, and was later moved to
minsyms.c:

Wed Jul 28 13:19:34 1993 Jim Kingdon (kingdon@lioth.cygnus.com)

* config/mips/xm-mips.h: Define HAVE_TERMIOS.

* dbxread.c (record_minimal_symbol): Don't put gcc_compiled or
__gnu_compiled* symbols into the minimal symbols.

(dbxread.c 1.153 in the internal Red Hat repository). There's no
indication of why the distinction is made. But it does seem to have
been done deliberately, rather than being the unintentional result of
accreted changes. So I guess we should leave it as is. I'll stick a
note in there after you've committed.