Put the static information about warnings in a structure, so one can
see what goes with what. Also, change the sense so "true" means
enabled.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Document the way the -O0 and -O1 options actually behave. -O0, in
particular, is NASM 0.98 compatibility mode.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-O0: JMP default to NEAR, Jcc/LOOP/JCXZ default to SHORT.
In other words, this is reverting to full-blown 0.98 behavior, not
0.98.39.
-O1: JMP and Jcc default to NEAR, LOOP/JCXZ default to SHORT (only
possible form).
Add a new builtin macro, __PASS__, which is either 1 (for a
preparatory pass), 2 (for a final pass, including preprocessor only),
or 0 (for dependency generation.) This might be useful in special
contexts.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Since the error directives, including %warning, are now issued in the
final pass only, it is important that we do *not* pass ERR_PASS1 with
%warning. Rather than playing even more ugly games in error(),
require ERR_PASS1 to be passed in with warnings elsewhere in the
preprocessor, just like the rest of the system.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
doc/changes.src should contain the user-visible changes in human
comprehensible form (release notes, not a changelog.) Get something
closer to what it should look like for 2.04.
We had different indentation levels only two paragraphs apart.
Overall, the document is horribly inconsistent about indentation,
which should be fixed.
There exists a fair bit of code out there which relies on the
optimizer in order to fit inside a predefined envelope. NASM 2.04rc4
breaks this; write a simple test to demonstrate.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Change global_offset_changed from bool to int so that
progress of convergence can be monitored. If change count
does not decrease from previous pass, increment stall counter.
If stall count reaches threshold, terminate assembly
with error message.
Now that there is proper forward reference resolution,
we can get rid of this junk. Wiping the flags also
removed the SBYTEnn flags, causing
cmp eax, a-b
a: nop
b:
to assemble with -Ox like
cmp eax, strict dword -1
This is now fixed.
%xdefine is an early-binding %define (%define being late-binding.)
There is nothing "enhanced" about it, it just specifies a different
policy. Call it a "resolving define" instead.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Users who wish to control the level of optimization can
continue to specify -O0, -O1, or -Ox,
where x can be the letter itself, or any number > 1.
However, even with optimization turned off,
NASM will always make enough passes to resolve
forward references. As a result, INCBIN is now the only
item left in the critical expressions list, although TIMES
still has its own constant value check.
Somehow the win32 and win64 aliases got listed on Mach-O, not on
COFF. This doesn't have any effect on the current code, but might in
the future. Correct.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Don't use explicit L's for things which are really size_t; not only is
it unnecessarily ugly, but it's wrong in a lot of ways. Do some other
minor stylistic cleanups.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
We would leave the output symbol type uninitialized. Explicitly
initialize it to zero (T_NULL, meaning no symbol type information),
since that's what was effectively done.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
When allocating the buffer for an mmacro list, we apparently failed to
guarantee space for the terminating NULL. This almost certainly
caused the crash described in BR 2048950, and quite possibly BR
1284169.