mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-27 08:10:07 +08:00
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>
This commit is contained in:
parent
70c09f0aac
commit
d558598ebe
@ -11,12 +11,12 @@ since 2007.
|
||||
|
||||
\b Fixed \c{subsections_via_symbols} for \c{macho} object format.
|
||||
|
||||
\b Support to mangle labels based on the types through \c{%pragma}. See
|
||||
\k{mangling}.
|
||||
|
||||
\b Added the \c{--gprefix}, \c{--gpostfix}, \c{--lprefix}, and
|
||||
\c{--lpostfix} command line options, to allow command line base symbol
|
||||
mangling. See \k{opt-pfix}.
|
||||
renaming. See \k{opt-pfix}.
|
||||
|
||||
\b Allow label renaming to be specified by \c{%pragma} in addition to
|
||||
from the command line. See \k{mangling}.
|
||||
|
||||
\b Supported generic \c{%pragma} namespaces, \c{output} and \c{debug}. See
|
||||
\k{gen-namespace}.
|
||||
@ -34,6 +34,13 @@ Instruction) instructions.
|
||||
\b Added the \c{STATIC} directive for local symbols that should be
|
||||
renamed using global-symbol rules. See \k{static}.
|
||||
|
||||
\b Allow a symbol to be defined as \c{EXTERN} and then later
|
||||
overridden as \c{GLOBAL} or \c{COMMON}. Furthermore, a symbol declared
|
||||
\c{EXTERN} and then defined will be treated as \c{GLOBAL}. See \k{extern}.
|
||||
|
||||
\b The \c{GLOBAL} directive no longer is required to precede the
|
||||
definition of the symbol.
|
||||
|
||||
\b Support \c{private_extern} as \c{macho} specific extension to the
|
||||
\c{GLOBAL} directive. See \k{macho-pext}.
|
||||
|
||||
@ -42,14 +49,7 @@ renamed using global-symbol rules. See \k{static}.
|
||||
\b Added the \c{--limit-X} command line option to set execution
|
||||
limits. See \k{opt-limit}.
|
||||
|
||||
\b Fixed \c{CPU} directive case insensitive
|
||||
|
||||
\b Fixed modules name for \c{ELF}, \c{IEEE}, \c{macho}, \c{obj} output format
|
||||
|
||||
\b Fixed to build \c{rdoff} tool and resolve to handle dependencies correctly
|
||||
with \c{Microsoft Visual Studio}
|
||||
|
||||
\b Fixed \c{Codeview} version number to be aligned with \c{MASM}.
|
||||
\b Updated the \c{Codeview} version number to be aligned with \c{MASM}.
|
||||
|
||||
\b Added the \c{--keep-all} command line option to preserve output
|
||||
files. See \k{opt-keep-all}.
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user