Commit Graph

4486 Commits

Author SHA1 Message Date
H. Peter Anvin (Intel)
b877708a83 Change unused -> unused_func to remove special case
The autoconf process automatically generates macros for function
attributes, including empty placeholders. Said empty placeholders also
propagate automatically into config/unconfig.h for the compilers which
don't support autoconf.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-01 20:49:04 -07:00
H. Peter Anvin (Intel)
fc3e4dcc65 NASM 2.15.02rc2 2020-06-30 17:35:34 -07:00
H. Peter Anvin (Intel)
c0d0f88261 preproc: expand_mmac_param_range() should be static
expand_mmac_params_range() lost its "static" in checkin
e99a946390. Put it back.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 17:33:39 -07:00
H. Peter Anvin (Intel)
8877a3ddb0 NASM 2.15.02rc1 2020-06-30 17:12:16 -07:00
H. Peter Anvin (Intel)
b68a375afc doc: index cleanups
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 15:05:20 -07:00
H. Peter Anvin (Intel)
3e70a213f6 gitattributes: don't try to merge the version file
Don't try to merge the version file... if there is a conflict, keep
the current version.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 13:48:13 -07:00
H. Peter Anvin (Intel)
39714f7de7 doc: document(!) documentation build requirements
The tools we need to build the documentation.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 13:47:17 -07:00
H. Peter Anvin (Intel)
4ddeb70428 doc: slight cleanup of MASM compatibility package information
Note that the extended DB syntax is also available, regardless of if
%use masm is used or not.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 13:37:29 -07:00
H. Peter Anvin (Intel)
7f1095a023 emptyarg.asm: add expansion test for a range with a single parameter
Add a test for %{1:1}, as reported in BR 3392611.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 12:54:21 -07:00
H. Peter Anvin (Intel)
a08c0f9adf changes.src: document %{:} macro parameter range fix
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 12:50:49 -07:00
H. Peter Anvin (Intel)
e99a946390 preproc: fix %{:} macro operand ranges
Fix the handling of %{:} macro operands. Use the same code for
expanding the subarguments as for normal arguments.

This (hopefully) resolves the following bug reports:
  BR 3392611, BR 3392686, BR 3392688

Reported-by: <coconutfaistoslimeregistry@gmail.com>
Reported-by: Jasper Lievisse Adriaanse <r+nasm@jasper.la>
Reported-by: Jason Hood <jadoxa@yahoo.com.au>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 11:51:41 -07:00
H. Peter Anvin (Intel)
5c85b7f87b changes.src: update changes for 2.15.02 (so far)
Begin the release note list for 2.15.02.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 10:47:34 -07:00
H. Peter Anvin (Intel)
f6a5c1ce20 doc: incbin: no need to mention an ancient Amiga assembler
There is no reason to mention an ancient Amiga assembler as the source
for INCBIN, especially since it is supported by quite a few other
assemblers.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 10:46:43 -07:00
H. Peter Anvin (Intel)
f397a3433d Make empty db statement a suppressable warning
Add a "db-empty" warning class to allow suppressing warnings.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 10:36:46 -07:00
H. Peter Anvin (Intel)
65ab3ab197 clang: mark inline functions unused and add warning options
clang, unlike gcc, will warn on inline functions which are
unused. This can happen if a function is either intended to be used in
the future, or it is only used under certain config options. Mark
those functions with the "unused" attribute; not only does it quiet
the warning, but it also documents it for the user.

Shuffle around the warning options in configure and add a few more
that are specific to clang.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 10:14:21 -07:00
H. Peter Anvin (Intel)
f21b2ba8f3 BR 3392687: clang miscompiles offsetin() for uninitialized pointer
The actual pointer value in offsetin() cancels out, but clang still
miscompiles offsetin() for an uninitialized pointer, considering the
value to be completely undefined. Initialize pointer being passed to
offsetin() to make clang happy; both the gcc and clang optimizers
discover later in the code that the initialization is unused and
removes it from the code.

Although technically undefined behavior, this is in my opinion a
severe quality of implementation bug in clang, and I will file a bug
report accordingly.

Reported-by: Jasper Lievisse Adriaanse <r+nasm@jasper.la>
Reported-by: David Bohman <debohman@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 09:54:01 -07:00
H. Peter Anvin (Intel)
14f41b2319 hash generators: rename UNUSED to UNUSED_HASH_ENTRY
The name UNUSED is too generic and may conflict with future
macro definitions. This is machine-generated code anyway, so
rename UNUSED to UNUSED_HASH_ENTRY.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 09:17:41 -07:00
H. Peter Anvin (Intel)
43a72dd638 listing: list short reserved blocks as ?? instead of <res ...>
<res ...> can get rather annoying when mixed in with data, as can
happen with the MASM-like db syntax. List shorter blocks (8 bytes or
less) as ?? instead; 8 bytes avoids line breaks for a single
statement.

This is probably more readable anyway...

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 23:30:33 -07:00
H. Peter Anvin (Intel)
296685b5e3 nasmdoc.css: use a relative size for code/pre
Use a percentage size modifier for code/pre, which hopefully should
allow it to respect enclosing size modifications (for headings.)

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 23:18:28 -07:00
H. Peter Anvin (Intel)
a4c0d009a0 nasmdoc.css: use a smaller font size for code text
Use a smaller font size for code text, just as for ps/pdf.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 23:16:13 -07:00
H. Peter Anvin (Intel)
d1a9f8a2f7 doc: actually *use* the smaller code font size...
Helps to actually use what is intended.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 23:10:50 -07:00
H. Peter Anvin (Intel)
18c0112c5b doc: for ps/pdf, use a smaller font for code
The text looks better using a smaller font for both inline code and
code paragraphs.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 23:03:09 -07:00
H. Peter Anvin (Intel)
de8817ddbc doc: clean up warnings formatting
When a warning documentation message contains more than one paragraph,
we have to indent the subsequent paragraphs using \> unless they are a
code paragraph (\c).

Improve a few warnings doc messages.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 22:30:50 -07:00
H. Peter Anvin (Intel)
444905e48b doc: some more cleanups and detailed specifications
Some more mostly editorial changes.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 16:50:56 -07:00
H. Peter Anvin (Intel)
fa7732e092 doc: editorial cleanups
Clean up the language of a few sections, add a few examples, and
better document %pragma limit.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 16:40:52 -07:00
H. Peter Anvin (Intel)
f0dc62c6a6 NASM 2.15.01 2020-06-27 16:15:25 -07:00
H. Peter Anvin (Intel)
aa542870ae changes.src: update for 2.15.01
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 16:14:50 -07:00
Henrik Gramner
bca6b26a7e insns.dat: Add Intel Control-Flow Enforcement Technology (CET) instructions
Add instructions for Intel Control Flow Enforcement Technology (CET).

Signed-off-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 16:12:37 -07:00
H. Peter Anvin (Intel)
57c375305c Makefile: add warnings.src to perlreq; longer list of binary files
Add warnings.src to PERLREQ.  If this isn't done, warnings.src ends up
in the xdoc tarball rather than the release tarball, which means that
unless the user can "make warnings" manually (which requires Perl)
then they can't build the documentation.

As this only affects the documentation build, it probably does not
warrant a point release.

Add a few more extensions to the list of recognized binary extensions
for the purpose of generating a .zip file with DOS line ending
conventions.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 16:04:38 -07:00
H. Peter Anvin (Intel)
a825b33423 NASM 2.15 2020-06-27 15:24:47 -07:00
H. Peter Anvin (Intel)
ea4c91bf32 NASM 2.15rc12 2020-06-26 16:20:27 -07:00
H. Peter Anvin (Intel)
29a61b7987 DWARF: consistent version information; drop .debug_loc section
Fix the version information for various sections and generalize their
implementation. Drop issuing an empty .debug_pubnames section; like
other sections DWARF parsers seem to be unhappy about a section with
null content.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-26 16:14:55 -07:00
H. Peter Anvin (Intel)
47d207d1a3 test: add Makefile target for elfx32
Add an .ox Makefile target for an ELFx32 object.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-26 16:14:31 -07:00
H. Peter Anvin (Intel)
eb571a3ac3 dwarf: don't emit a dummy .debug_loc section
It seems DWARF parsers get really snippy about a section which only
contains an end token. Instead, leave unused sections empty. Already
did that with .debug_frame, do it with .debug_loc too.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-26 15:22:26 -07:00
H. Peter Anvin (Intel)
241697306c BR 3392650: Codeview truncates symbol table length to 16 bits
If the source code is large, it is very reasonable for the symbol
table length to exceed 2^16 bits. Use uint32_t to keep track of
lengths, even where not necessary... there is no real reason to use
uint16_t anywhere.

Reported-by: <michael@mehlich.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-26 14:10:54 -07:00
H. Peter Anvin (Intel)
922afbfc6c test: enable debugging output
There is no reason why we should not emit debugging output when
compiling test files for manual analysis, quite the contrary.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-26 14:09:47 -07:00
H. Peter Anvin (Intel)
82fc1bea76 doc: document operator and Dx changes
Document new operators, removal of special casing for %if, and the
MASM-like enhancements to the Dx directives.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-25 15:46:09 -07:00
H. Peter Anvin (Intel)
f27ba95051 NASM 2.15rc11 2020-06-25 14:11:05 -07:00
H. Peter Anvin (Intel)
45978bb8bc BR 3392651: fix the .debug$T section in Codeview output format
The cv8 output format would generate an invalid .debug$T section,
containing repeated invalid records, none of which are actually used
(which is probably the only reason it actually worked.)

Just in case, generate a *single* type record for void func(void);

Furthermore, the argument list record should come before the procedure
type record (forward references are at least normatively prohibited.)

Reported-by: Alexandre Ganea <alexandre.ganea@ubisoft.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-25 13:57:44 -07:00
H. Peter Anvin (Intel)
7869531f27 NASM 2.15rc10 2020-06-22 13:52:46 -07:00
H. Peter Anvin (Intel)
d85a6101d7 BR 3392681: handle a64 instruction patters correctly
The a64 instruction patterns would incorrectly force REX to zero at a
point where REX prefixes have already been assigned. This is not only
incorrect in case of instructions which can use high registers, but it
causes an assertion failure. It happened to work for J*CXZ and LOOP*.

Reported-by: Philip Lantz <philip.lantz@intel.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-22 13:52:02 -07:00
H. Peter Anvin (Intel)
6e9554f067 BR 3392648: rename float.[ch] to floats.[ch]
Haiku apparently wants to include <float.h> rather than
"float.h". Rename float.[ch] to floats.[ch] to avoid unnecessary
namespace confusion.

Reported-by: <alaviss0+nasm@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-14 23:24:43 -07:00
H. Peter Anvin (Intel)
c4f95ca862 NASM 2.15rc9 2020-06-14 23:18:22 -07:00
H. Peter Anvin (Intel)
a6ea1152bc BR 3392657: dwarf: leave .debug_frame empty
Until such time that we have a CFI code generator, leave .debug_frame
empty.

Reported-by: Philip Craig <philipjcraig@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-14 23:16:50 -07:00
H. Peter Anvin (Intel)
7acbaf523c NASM 2.15rc8 2020-06-14 22:45:13 -07:00
H. Peter Anvin (Intel)
d499755f54 doc: various documentation updates 2020-06-14 22:43:47 -07:00
H. Peter Anvin (Intel)
3957f6f831 %line: quote filenames with double spaces, use unsigned char check
Filenames with double spaces need to be quoted; the preprocessor will
otherwise collapse spaces into one.

When comparing for control characters and spaces, use an unsigned
compare.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-14 20:17:57 -07:00
H. Peter Anvin (Intel)
b292748d9f preproc, srcfile: much saner handling of %line directives
%line directives really need to be preprocessed early, before normal
directive processing. In particular, they are *not* affected by such
thing as smacro expansion, or deferred into an mmacro expansion.

The %line directive is special because it is explicitly indented to be
inserted by an external preprocessor, which can happen at any point.

For mmacro and rep expansions, store the current file and line for
each expansion line. Similarly, let each istk entry contain such
information.

Don't emit empty lines in preprocessing-only mode when we are
already required to issue a %line directive anyway. This cuts down on
clutter a fair bit.

Quote filenames in %line directives (and accept quoted filenames in
%line directives) if and only if it is necessary for
disambiguation. This is required if:

1. The filename contains control characters;
2. The filename begins or ends with whitespace or a quotation mark;
3. The filename is empty.

Otherwise issue the filename as-is, for backwards compatibility.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-14 20:09:11 -07:00
H. Peter Anvin (Intel)
4ed23c8f85 preproc.c: make extra sure we always have a null-terminated token
tok_set_text() and tok_set_text_free() take a length argument, which
could at least theoretically mean that we don't have a null-terminated
string. Directly enforce a null-terminated string in all cases.

In the future this means that it is legal to intentionally use these
functions to tokenize a substring.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-14 19:55:49 -07:00
H. Peter Anvin (Intel)
00335e43ef preproc.c: make extra sure tokens are always null-terminated
In tok_set_text() and tok_set_text_free(), don't trust that
the caller has given us a zero-terminated string.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-14 19:49:19 -07:00