[patch ld PE-COFF]: Use bfd target's underscoring default and add option --(no-)leading-underscore for ld

Dave Korn dave.korn.cygwin@googlemail.com
Tue Mar 23 19:28:00 GMT 2010


On 23/03/2010 18:52, Kai Tietz wrote:

> Well, I agree that those patterns are repeating. The reason why I
> avoid to make helper-macros here was to show logic explicit and the
> arguments are varying a bit, so that in fact at least two macros are
> necessary.
> But I can rework it to use a macro version for it, if you prefer.

  I think macro definitions show the logic well enough in generalised form
that there's no real gain from writing it out longhand, plus they provide a
handy central point to comment them and explain what they're doing, so yes
please.

>> at all.  Semantically, it amounts more to a "this one is the one that gets the
>> special handling for ImageBase" flag than anything else, I think.
> 
> Well, this issue isn't nice looking but IMHO necessary. The point here
> is that __ImageBase is the name of the symbol-name used in C. So an
> additional underscore is necessary for targets prefixing C-symbols.

  Maybe it would be best renamed as "is_c_symbol" then, with a comment saying
"0 => assembler-level (i.e. unprefixed) symbol, 1 => C visible (i.e.
prefixed)" or words to that effect?

>>  (While you're thinking about that, I'll give it a bit of testing on cegcc
>> and pals.)
> 
> Hope it doesn't show side-effects there. I assume none, but well ...

  If anything crops up, I'll fix it.  They aren't mainstream targets yet, but
I like to keep things clean in anticipation that they'll want to merge
upstream someday.

    cheers,
      DaveK



More information about the Binutils mailing list