This is the mail archive of the
mailing list for the binutils project.
Re: .comm symbol, 0
>>> Ian Lance Taylor <email@example.com> 10.11.05 18:39:41 >>>
>"Jan Beulich" <JBeulich@novell.com> writes:
>> Is it correct that for ELF, as I would see at least as a reasonable
>> option, this produces a 1-byte common symbol, but for COFF (maybe
>> others) this produces an undefined extern? Shouldn't this be an
>> I'm asking because apparently only ELF sets the section for common
>> symbols to bfd_com_section, others rely on the value of the symbol
>> non-zero. If I want to finally resolve the symbol redefinition
>> need to also be able to detect common ones, and S_IS_COMMON (due to
>> fact just mentioned) doesn't reliably recognize them, nor are they
>> recognizable through S_IS_DEFINED.
>Shouldn't a zero-sized common symbol simply be an error? What does
That is my point. The issue really is if, in order to find out whether
a symbol is common, one can, short of S_IS_COMMON not always being
usable, rely on this being in the undefined section (!S_IS_DEFINED) and
having a non-zero value (S_GET_VALUE or similar), just like write.c does
to detect them.
Whether treating a zero-sized common as extern undefined or forcing it
to have size 1 would the subject of a different patch then.