aboutsummaryrefslogtreecommitdiffstats
path: root/doc/nasmdoc.src
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2018-06-25 18:19:15 -0700
committerH. Peter Anvin (Intel) <hpa@zytor.com>2018-06-25 18:19:15 -0700
commitd558598ebe15279f346f748e8581de24ca63a0c1 (patch)
tree565893e1b37bc367a0fbc324ad880ff3b8d9ea66 /doc/nasmdoc.src
parent70c09f0aac79167a68e51b78b0d4f0061cb79f25 (diff)
downloadnasm-d558598ebe15279f346f748e8581de24ca63a0c1.tar.gz
nasm-d558598ebe15279f346f748e8581de24ca63a0c1.tar.xz
nasm-d558598ebe15279f346f748e8581de24ca63a0c1.zip
doc: add a few more updates
In particular, document the new behavior of EXTERN, GLOBAL and COMMON. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'doc/nasmdoc.src')
-rw-r--r--doc/nasmdoc.src20
1 files changed, 10 insertions, 10 deletions
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src
index b0db9d59..c2e80a8f 100644
--- a/doc/nasmdoc.src
+++ b/doc/nasmdoc.src
@@ -4604,8 +4604,12 @@ only in that it can take only one argument at a time: the support
for multiple arguments is implemented at the preprocessor level.
You can declare the same variable as \c{EXTERN} more than once: NASM
-will quietly ignore the second and later redeclarations. You can't
-declare a variable as \c{EXTERN} as well as something else, though.
+will quietly ignore the second and later redeclarations.
+
+If a variable is declared both \c{GLOBAL} and \c{EXTERN}, or if it is
+declared as \c{EXTERN} and then defined, it will be treated as
+\c{GLOBAL}. If a variable is declared both as \c{COMMON} and
+\c{EXTERN}, it will be treated as \c{COMMON}.
\H{global} \i\c{GLOBAL}: \i{Exporting Symbols} to Other Modules
@@ -4616,9 +4620,6 @@ linker errors, some other module must actually \e{define} the
symbol and declare it as \c{GLOBAL}. Some assemblers use the name
\i\c{PUBLIC} for this purpose.
-The \c{GLOBAL} directive applying to a symbol must appear \e{before}
-the definition of the symbol.
-
\c{GLOBAL} uses the same syntax as \c{EXTERN}, except that it must
refer to symbols which \e{are} defined in the same module as the
\c{GLOBAL} directive. For example:
@@ -4673,11 +4674,10 @@ only one argument at a time.
\H{static} \i\c{STATIC}: Local Symbols within Modules
-Opposite to \c{EXTERN} and \c{GLOBAL}, \c{STATIC} is local symbol,
-but should be named according to the global mangling rules (named
-by analogy with the C keyword "static" as applied to the functions).
-And like \c{GLOBAL} directive, the directive applying to a symbol
-should be \i{before} the definition of the symbol. For example:
+Opposite to \c{EXTERN} and \c{GLOBAL}, \c{STATIC} is local symbol, but
+should be named according to the global mangling rules (named by
+analogy with the C keyword \c{static} as applied to functions or
+global variables).
\c static foo
\c foo: