This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug or feature: symbol names of global/extern variables





"Jan Beulich" <JBeulich@novell.com> wrote on 06/10/2005 17:48:13:

> Using debug info wouldn't help much, because there's no guarantee it'll
> ever be available. And in my opinion debug info free builds are
> generally more important, because those normally are where production
> code gets generated.

I disagree. When developing code, you'd normally generate and use
debug information. This is when you would like to catch these errors,
not in production code (which comes late in the development cycle).

> Of course, if it's available, the linker might want
> to consider it, but I'd say this isn't worth a lot of to-be-added code

I am not sure about that. If you have a good methodology and
reasonable libraries, you have almost no chance to hit this kind of
problems. All you need is to write "extern" only in the header files,
and whenever you'd declare a global symbol, you'd also include
the header file that contains the "extern".

However for legacy code, and for programmers that do not have
a reasonable methodology this issue may raise quite often. When
this issue arises, its cost may be very big.

The last time I had such a problem was a decade ago. It involved
flex/lex incompatibility of yytext ; one defines it as char* and
the other as char[]. This issue is probably in some FAQ, and I
guess that many people encountered that at one point or another
in their carrier. I don't known how may person years this one
has cost for legacy code that defines "extern char yytext[]".

> (not knowing the linker internals, and thus how far it is from having
> the information at hand). Jan
[...]

As usual, cost-benefit analysis will be performed (by whoever
may be interested to implement it). I guess that if it takes
one day to implement, then some kind soul may go on and do it.
If it takes a month, then I doubt that anyone will do it (unless
this person has a very serious itch to scratch).

  Michael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]