mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-02-23 17:29:23 +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 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
|
\b Added the \c{--gprefix}, \c{--gpostfix}, \c{--lprefix}, and
|
||||||
\c{--lpostfix} command line options, to allow command line base symbol
|
\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
|
\b Supported generic \c{%pragma} namespaces, \c{output} and \c{debug}. See
|
||||||
\k{gen-namespace}.
|
\k{gen-namespace}.
|
||||||
@ -34,6 +34,13 @@ Instruction) instructions.
|
|||||||
\b Added the \c{STATIC} directive for local symbols that should be
|
\b Added the \c{STATIC} directive for local symbols that should be
|
||||||
renamed using global-symbol rules. See \k{static}.
|
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
|
\b Support \c{private_extern} as \c{macho} specific extension to the
|
||||||
\c{GLOBAL} directive. See \k{macho-pext}.
|
\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
|
\b Added the \c{--limit-X} command line option to set execution
|
||||||
limits. See \k{opt-limit}.
|
limits. See \k{opt-limit}.
|
||||||
|
|
||||||
\b Fixed \c{CPU} directive case insensitive
|
\b Updated the \c{Codeview} version number to be aligned with \c{MASM}.
|
||||||
|
|
||||||
\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 Added the \c{--keep-all} command line option to preserve output
|
\b Added the \c{--keep-all} command line option to preserve output
|
||||||
files. See \k{opt-keep-all}.
|
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.
|
for multiple arguments is implemented at the preprocessor level.
|
||||||
|
|
||||||
You can declare the same variable as \c{EXTERN} more than once: NASM
|
You can declare the same variable as \c{EXTERN} more than once: NASM
|
||||||
will quietly ignore the second and later redeclarations. You can't
|
will quietly ignore the second and later redeclarations.
|
||||||
declare a variable as \c{EXTERN} as well as something else, though.
|
|
||||||
|
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
|
\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
|
symbol and declare it as \c{GLOBAL}. Some assemblers use the name
|
||||||
\i\c{PUBLIC} for this purpose.
|
\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
|
\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
|
refer to symbols which \e{are} defined in the same module as the
|
||||||
\c{GLOBAL} directive. For example:
|
\c{GLOBAL} directive. For example:
|
||||||
@ -4673,11 +4674,10 @@ only one argument at a time.
|
|||||||
|
|
||||||
\H{static} \i\c{STATIC}: Local Symbols within Modules
|
\H{static} \i\c{STATIC}: Local Symbols within Modules
|
||||||
|
|
||||||
Opposite to \c{EXTERN} and \c{GLOBAL}, \c{STATIC} is local symbol,
|
Opposite to \c{EXTERN} and \c{GLOBAL}, \c{STATIC} is local symbol, but
|
||||||
but should be named according to the global mangling rules (named
|
should be named according to the global mangling rules (named by
|
||||||
by analogy with the C keyword "static" as applied to the functions).
|
analogy with the C keyword \c{static} as applied to functions or
|
||||||
And like \c{GLOBAL} directive, the directive applying to a symbol
|
global variables).
|
||||||
should be \i{before} the definition of the symbol. For example:
|
|
||||||
|
|
||||||
\c static foo
|
\c static foo
|
||||||
\c foo:
|
\c foo:
|
||||||
|
Loading…
Reference in New Issue
Block a user