How should I flag a COMMON(ly) declared symbol in my assembler, so that
when the COFF object file is generated the linker will know that symbol
was declared as COMMON?
> Hey guys,
>
> How should I flag a COMMON(ly) declared symbol in my assembler
Which assembler? Or are you asking for good syntax to use in an assembler
you're currently writing?
--
My address happens to be com (dot) gmail (at) usenet (plus) chbarts,
wardsback and translated.
It's in my header if you need a spoiler.
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
I am writing an assembler, as a project, and I am trying to allow for
coff file generation.
However I am having trouble understand how a COMMON defined symbol will
be known to the linker to be COMMON because, in COFF documentation, I
don't see any difference between a COMMON and an EXTERN or GLOBAL
symbols...
These are three different things. It works like this:
If a symbol is declared as GLOBAL, by say .global, it is defined in this
object and exported to other objects. This means that other objects can
refer to this same symbol and get the same value.
If a symbol is declared EXTERNAL, by say .extern, it is defined in some
other object and gets its value at link time. It is an error to refer to
an external symbol which is not defined anywhere else.
If a symbol is declared COMMON, by say .common, it is placed in the .bss
section and merged with all other instances of the same symbol at link
time. This means that more than one object may declare the symbol as
common, but if it is only declared here, it is still defined. All
objects linked together will get the same instance of the symbol, as
long as they all declare it as common.
Bjarni
--
INFORMATION WANTS TO BE FREE