Fix the disassembly of the alternate forms of register-register
MOVAPD, MOVDQA, MOVDQU, MOVQ, MOVSD, and MOVUPD.
NASM never generates these, but they would be disassembled
incorrectly.
WAIT is technically an instruction, but from an assembler standpoint
it behaves as if it had been a prefix. In particular, it has to be
ordered *before* any real hardware prefixes.
The documentation says that constructs with %$...$foo can be used
to access macros from deeper in the context stack. From what
I can tell, that has never actually worked, since we'd enter names
like %$foo into the context-local macro name table. Instead, only
insert the tail of the macro name into the context-local table;
expand get_ctx to also return a pointer to the macro name proper;
this is rather straightforward since we'd usually save away that
name at the point get_ctx is called anyway.
We have a number of all-zero buffers in the code. Put a single
all-zero buffer in nasmlib.c. Additionally, add fwritezero()
which can be used to write an arbitrary number of all-zero bytes;
this prevents the situation where the all-zero buffer is simply
too small.
When a section other than .text has a start < origin, we would
segfault; fix that.
Furthermore, at bin_cleanup() we don't have usable file/line
information, so pass ERR_NOFILE to the error() function. Perhaps less
than ideal, but better than printing a null pointer.
Update the VFMA* instructions to match the AVX spec version 5.
Since these are highly regular, use a small Perl script to generate
the instruction patterns.
Checkin 4b9358928b changed the version
message from stdout to stderr, but:
a) doesn't motivate the change in the commit log;
b) bundles that with other changes;
c) is inconsistent with other programs;
d) was done by me and I can't remember any reason for it.
Hence conclude it was unintentional and therefore a bug. Since this
commit was done after 2.05.01 no stable release has been affected.
Module labels.c has code to issue error message when global
directive appears after symbol definition, but the test condition
was incorrectly punctuated.
I realized that a documentation change is required to inform users about the
addition of entry point support for the as86 format. The following produces
reasonable output for .txt output, but I am blind and so can't check the
other formats as readily.
Previously, the ELF backends silently ignored incorrect or unknown
attributes on section declarations, and therefore used default values
in cases where the user had make an error in attempting to specify
custom values.
I needed entry point support with the as86 format, and after looking through
the archives found a similar desire from someone in 2002. For some reason
such a patch never made it into the code, even though the required flag
value is present, so I offer the a patch of my own.
I compared against what is done in the .obj format and the approaches are
quite similar which I hope will aid in its acceptability. While I have
tested it extensively it does do the job asked, and I'm honestly not sure
what extensive testing of the change would look like.
Several projects have taken to using .text to store read-only data
when building on Mac OS X due to crashes in SSE code from the .rodata
section being mis-aligned. It seems there was a misunderstanding about
how ld/ld64 handles section alignment in outmacho.c so I wrote a patch
to fix it. I tested it against x264 git, modified it to use ".rodata
align=16" for the data section and use movdqa instructions (guaranteed
to crash when built with unpatched nasm) and it passed all tests in
its checkasm tool.
If you want more data I can provide, but it's late and I've had a
couple glasses of mulled wine :)
-DrD-
Linear searches are evil, so use an llrbtree to search for symbols by
offset. This doesn't change the preexisting behaviour that we only
look for global symbols.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The POPCNT instruction should not require sizes on memory operands.
Add the appropriate size flags for that to work.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>