Checkin c33d95fde9:
BR 3392370: {z} decorator allowed on MOVDQ* memory operands
... inadvertently broke broadcast operations, which only apply to
memory operands and therefore were only handled in one of the two
brace-parser implementations. Fix that.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Passing an object to nasm_zero() allows us to use it on arrays.
Otherwise the array will decay to a pointer and silently clear only
the first member of the array!
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
When we make an artificial RESB instructions (due to isolated
prefixes) we need to make sure there isn't any crap left in the
operands structure. The easiest way to guarantee that is to force it
to zero.
Reported-by: Henrik <henrik@gramner.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
The spec says very clearly the {z} decorator is allowed on memory
operands for the MOVDQ* instructions. Remove special cases from the
code to disallow this case, which had the unfortunate effect of
generating a very uninformative error message.
Reported-by: Agner <agner@agner.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
A raw data dump can potentially be very large, especially when
incbin is used. Allow a %pragma for setting the maximum dump
size (defaults to 128 bytes.)
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Update the debug output format to dump (most of) the information that
is available via the new backend format, as well as the legacy backend
format -- probably the only backend ever which will ever want both!
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
There is no reason to keep a private copy of the value of
"globalbits", which needs to be kept in sync anyway. With the move of
directive processing to a separate file, this variable wasn't kept up
to date, resulting in failures.
This resolves BR 3392390.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
If a displacement is as large as the address size currently in use
(which is the norm except for 64-bit code), then we should use
OUT_WRAP rather than OUT_UNSIGNED; the sign doesn't matter at all.
This resolves BR 3392391.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
We are missing @next access here so in result we
might allocate same name several times.
Reported-by: "Bae, Chang Seok" <chang.seok.bae@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
The target of all this code rework is to
start using general backend engine with
native Elf types behind.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This should be more convenient. At least both headers
are well documented in specifications so we simply
follow them.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
We don't have any elf pragmas yet, but we want to be able to do
"%pragma elf" and have it work for any of the elf formats.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Implement the MachO do_dead_strip directive, which sets a flag on the
corresponding section. This as well as subsections_by_symbols are
reimplemented as pragmas; if someone uses the predefined macro they
still get the expected behavior.
However, this allows someone to write:
%pragma macho subsections_by_symbols
... and have it ignored if compiling for, say, ELF.
Also, implement the following section attributes:
zerofill, no_dead_strip, live_support, strip_static_syms
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
If the handler is NULL, then all pragmas are by definition unknown, so
treat them exactly as if we had received DIRR_UNKNOWN from the
handler.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Very few things have any desire to do its own string parsing, and the
directives hash is already a plain string-to-numbers O(1) hash. The
namespace is small enough that even if it makes some switch statements
compile a bit larger there is no real reason to have separate hashes,
even if the actual code as opposed to the data structure was shared.
So, for right now, just throw them together in one big happy pot.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Make -Werror possible to control on a per-warning-class basis. While
I was fixing up that code anyway, merge the handling of the -w, -W and
[warning] argument and directives.
Furthermore, make *all* warnings suppressible; any warning that isn't
categorized now belong to category "other". However, for cleanliness
sake an "other" option does not get listed in the warning messages.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
The "subsection_via_symbols" directive simply sets a flag in the
Mach-O file header.
Requested in BR 3392367.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
The directives code is already trying to do a bit more unified error
handling, so give ourselves a bit richer interface. At this point,
the conversion was pretty automatic so we probably return DIRR_OK
instead of DIRR_ERROR in a fair number of places, but that's okay.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>