Commit graph

4575 commits

Author SHA1 Message Date
H. Peter Anvin (Intel)
6f52ecfa49 changes.src: update with current state of 2.15.03
Add release notes for 2.15.03 as it currently exists.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-07 09:33:42 -07:00
H. Peter Anvin (Intel)
47f8399667 NASM 2.15.03rc1 2020-07-06 21:51:40 -07:00
H. Peter Anvin (Intel)
cd87431424 BR 3392692: outcoff: allow user to reduce the default alignment
NASM would incorrectly only allow for the alignment to be increased,
even when overridden by the user. Allow the user to specify any
alignment value and have it override the partition type default.

The user can increade their own alignment value specification later,
of course, and the sectalign directive will present a floor for either
kind of specification.

Reported-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 21:46:43 -07:00
H. Peter Anvin (Intel)
178148c876 compiler.h: safer/more portable version of offsetin()
Still technically not defined behavior, but this *should* work on all
reasonable or semi-reasonable systems.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 17:13:02 -07:00
sezero
c0ab5a8be9 rdflib.c (main): change incorrect break statement to /* fall through */
Commit 6d36d8684 added a wrong break statement to case 'x'
in rdflib.c::main() at line235.  That case 'x' must "fall
through" into case 't' which re-checks the argument.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 13:20:09 -07:00
sezero
741967033e rdflib.c: add back timestamp size to header in library creation.
Commit 8dc965347 removed writing of the timestamp size to library
header. (Accidentally, I guess??) The attached patch adds it back.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 13:17:42 -07:00
sezero
1969dab9c6 portability: Watcom C portability updates
- config/watcom.h: update.
- Mkfiles/openwcom.mak: -wcd=124 to silence "Comparison result always 0"
  warnings from error.h::debug_level()

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 13:02:26 -07:00
H. Peter Anvin (Intel)
1348627b72 compiler.h: add missing #endif
Embarrassing: missing #endif

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 12:50:12 -07:00
H. Peter Anvin (Intel)
30844a4c62 offsetin(): use typeof() if the compiler supports it
If the C compiler has typeof(), we can use a safer implementation of
the offsetin() macro by using typeof(). Since typeof() isn't standard
(yet?) autoconf has to test for it.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 12:39:14 -07:00
H. Peter Anvin (Intel)
70f0d04ee5 configure.ac: -enable-... breaks other compilers, so hope for clang 10
The -enable-... option to enable -ftrivial-auto-var-init=zero breaks
linking not just on clang but on other compilers (gcc) too. Drop it;
this feature is enabled by default in clang 10.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 11:30:22 -07:00
H. Peter Anvin (Intel)
e2040291ec config/unconfig.h: generate by Makefile, not autogen.sh
config/unconfig.h really is no different than the other perlreq files,
so move it into the Makefile. This has the extra advantage that
config/unconfig.h no longer needs to be kept in the source repository.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 11:12:03 -07:00
H. Peter Anvin (Intel)
e8599c655e pa_func_attributes.m4: better messages
It is a bit confusing when the alloc_size attribute is tested for more
than once, to include the arguments in the output message.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 11:09:03 -07:00
H. Peter Anvin (Intel)
0da8a88c62 clang: add -ftrivial-auto-var-init=zero
The clang behavior is sometimes really weird, and extremely hard to
debug, when uninitialized variables are used even if the value cancels
out in an expression. It also depends on optimization level, etc.

-ftrivial-auto-var-init=zero makes the behavior
predictable. Unfortunately it also needs a really weird "enable"
option, and it issues a warning about an unused command line option on
link, which may get promoted to error, so silence the warning before
doing anything else.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 10:19:38 -07:00
H. Peter Anvin (Intel)
ecb9b773f2 test/Makefile: the debug option for -f dbg is -gdebug
If a format is specified explicitly for the debug format, it needs to
be "debug", not "dbg". Lovely inconsistency.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 10:19:38 -07:00
H. Peter Anvin
f293842b8a Merge remote-tracking branch 'github/nasm-2.15.xx' 2020-07-05 15:34:46 -07:00
H. Peter Anvin
a6fd383126 travis: weirdpaste.i now has better line directives
The %line directives in weirdpaste.i now better reflect the actual
lines of the source code, just as we would have for debugging
output. Update the reference version of weirdpaste.i accordingly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2020-07-05 15:31:36 -07:00
H. Peter Anvin
63769c588e Merge remote-tracking branch 'github/nasm-2.15.xx' 2020-07-05 15:27:04 -07:00
H. Peter Anvin (Intel)
122c5fb759 preproc: handle %+ pasting after empty expansions
%+ tokens can end up next to each other, or at the beginning or the
end of an expansion if we try to paste the output of empty
macros. This is perhaps particularly likely to happen in %[]
expressions.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-05 03:39:04 -07:00
H. Peter Anvin (Intel)
5b7369d7e0 Make debug info and error messages correctly reflect macros and reps
1. Error messages would issue with the line number of %endrep.
2. Debug line information would ignore both macros and reps.
   This is doubly wrong; macros are semantically equivalent to
   inline functions, and it is expected that debuggers trace
   into these functions.

These changes finishes the last parts of moving all responsibility for
the listing enable/disable into the preprocessor, so remove the
way over-complicated macro inhibit facility from the listing module
entirely.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-05 02:16:13 -07:00
H. Peter Anvin (Intel)
87a832e391 BR 3392691: errors: issue ERR_PASS2 messages in preproc-only mode
In preproc-only mode, we only ever execute a single pass, so we need
to still issue error messages created during that pass, otherwise we
don't even generate %warning or %error messages...

Reported-by: Jason Hood <jadoxa@yahoo.com.au>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-03 19:02:37 -07:00
Cyrill Gorcunov
37c0942409 travis/test: Update version test
Just to eliminate warning, nothing serious.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-07-03 11:04:42 +03:00
Cyrill Gorcunov
d390490089 outlib: Make ol_add_sym_to being static
Otherwise getting building problem

 > output/outlib.c:197:6: error: no previous prototype for ‘ol_add_sym_to’ [-Werror=missing-prototypes]
 >   197 | void ol_add_sym_to(struct ol_symlist *syml, struct ol_symhead *head,
 >       |      ^~~~~~~~~~~~~

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-07-03 11:01:40 +03:00
H. Peter Anvin (Intel)
61be48a383 doc: swap 'hyphen' and 'minus' in PostScript definition
It appears that at least with the Adobe Source fonts:

'hyphen' -> U+002D (ASCII)
'minus'  -> U+2212

This is ugly for cut & paste purposes.

Reported-by: C. Masloch <pushbx@ulukai.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-02 21:06:29 -07:00
H. Peter Anvin (Intel)
1b50fec496 outlib: fix infinite recursion due to incorrect wrapping
recursion: see recursion.

A wrapper function needs to call the function being wrapped, not
itself.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-02 20:48:43 -07:00
H. Peter Anvin (Intel)
1939b69fdf Merge remote-tracking branch 'github/nasm-2.15.xx' 2020-07-02 20:44:57 -07:00
Jasper Lievisse Adriaanse
07b10a1706 doc: remove references to sourceforge
The mailinglists have been migrated to lists.nasm.us

Signed-off-by: Jasper Lievisse Adriaanse <j@jasper.la>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-01 21:48:44 -07:00
H. Peter Anvin (Intel)
97e53e95f9 NASM 2.15.02 2020-07-01 21:42:17 -07:00
H. Peter Anvin (Intel)
fee0db94a3 changes.src: fixed Mkfiles/msvc.mak
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-01 21:31:32 -07:00
H. Peter Anvin (Intel)
147f32a6eb msvc.mak: fix syntax for excluding config.h
mkdep.pl wants a / regardless of what the target path separator is.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-01 21:13:27 -07:00
H. Peter Anvin (Intel)
c665ba1fd8 strlist.h: move safe_alloc declaration
Move the safe_alloc declaration after the * symbol to be consistent
with all other functions with this attribute. Just in case it matters
somewhere...

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-01 20:54:58 -07:00
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)
8bc18080fe Merge tag 'nasm-2.15.02rc2'
NASM 2.15.02rc2
2020-06-30 17:53:13 -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)
a3db726f02 Merge remote-tracking branch 'github/nasm-2.15.xx'
Resolved Conflicts:
	version

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 17:14:36 -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)
367350319b rbtree: implement a "threaded LLRB tree"
Change the left-leaning red-black (LLRB) trees into left-leaning
threaded red-black trees. Instead of NULL pointers at leaf nodes, use
the otherwise unused field as a pointer to the lexical predecessor
(left) or successor (right). This allows fast previous/next
interator operation without needing to keep track of the root of the
tree at all times.

The additional metadata that needs to be kept can be done for "free"
simply by changing "bool red" into a flag field.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-29 23:23:51 -07:00