Table of Contents
win32 object format generates Microsoft
Win32 object files for use
on the 32-bit native Windows
XP (and Vista) platforms. Object files produced using this object format may be linked
with 32-bit Microsoft linkers such as Visual Studio in order to produce 32-bit PE executables.
Note that although Microsoft say that Win32 object files follow the
COFF (Common Object File Format) standard, the object files produced by
Microsoft Win32 compilers are not compatible with COFF linkers such as DJGPP’s, and
vice versa. This is due to a difference of opinion over the precise semantics of
PC-relative relocations. To produce COFF files suitable for DJGPP, use the
coff output format; conversely, the
format does not produce object files that Win32 linkers can generate correct output
win32 object format allows you to specify additional
information on the
SECTION directive line, to control the
type and properties of sections you declare. Section types and properties are generated
automatically by Yasm for the standard section names
.bss, but may still be overridden
by these qualifiers.
The available qualifiers are:
code. Data sections are marked as readable and writable, but not executable.
datadeclares an initialized data section, whereas
bssdeclares an uninitialized data section.
info-type section called
.drectvecauses the linker to interpret the contents of the section as command-line options.
Other qualifiers are supported which control specific section flags:
base. Each of these sets the
similarly-named section flag, while prefixing them with
clears the corresponding section flag; e.g.
the discard flag.
The defaults assumed by Yasm if you do not specify the above qualifiers are:
section .text code align=16 section .data data align=4 section .rdata rdata align=8 section .rodata rdata align=8 section .rdata$ rdata align=8 section .bss bss align=4 section .drectve info section .comment info
Any other section name is treated by default like