Commit Graph

3595 Commits

Author SHA1 Message Date
H. Peter Anvin
e580466254 .gitignore: add more test file extensions
More file extensions used in the test directory to be ignored.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 15:32:37 -07:00
H. Peter Anvin
e38654a24e BR 3392411: smartalign: make sure we always define the end symbol
We need to always define the end symbol, otherwise we might find
ourselves in a situation where the alignment code grows (common!) and
then the symbol is defined late.

Reported-by: ig <glucksmann@avast.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 15:29:01 -07:00
H. Peter Anvin
94ead27971 BR 3392437: Fix diagnostic for negative value in TIMES
Issue a diagnostic and don't panic for invalid TIMES values.

Reported-by: C. Masloch <pushbx@38.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 15:22:23 -07:00
H. Peter Anvin
230db148a3 outelf.c: fix a typo in previous commit
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 15:12:03 -07:00
H. Peter Anvin
e4303ee7f1 BR 3392417: always end the DWARF .debug_abbrev section with a null
The DWARF spec specifies that the .debug_abbrev section always should
end with a null byte.  Existing tools don't seem to care, but some
issue a warning, and it is invalid according to spec.

Reported-by: Darren Sylvain <sylvaindarren@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 15:05:03 -07:00
H. Peter Anvin
f91dc2033d .gitignore: add .mo and .mo64 as generated file extensions
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 14:43:43 -07:00
H. Peter Anvin
621603da26 BR 3392418: MachO: support 16-character section names, debug flag
Support 16-character section names, and support the debug section
flag.

Reported-by: Andrey Timofeyev <timofeyev@bk.ru>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 14:42:08 -07:00
H. Peter Anvin
72a85f146e .gitignore: ignore *.dep
*.dep are automatically generated dependency files; ignore them.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 14:26:33 -07:00
H. Peter Anvin
d5e7c072bd test: add test code for BR 3392439
Bug report BR 3392439 test code.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 14:25:44 -07:00
H. Peter Anvin
e800127a46 BR3392439: make sure to update globalbits if appropriate
For some output types, the bit size, globalbits, follow the section
(segment); make sure we actually update it!

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 14:22:16 -07:00
H. Peter Anvin
5e03c443e4 .gitignore: add *.od and /misc/omfdump
A few generated files missing from .gitignore.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 13:48:09 -07:00
H. Peter Anvin
0bee4942a9 NASM 2.13.02rc1 2017-08-16 22:54:50 -07:00
H. Peter Anvin
f275ce9c88 doc: update for upcoming 2.13.02 release
Update release notes and documentation for 2.13.02.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 22:36:32 -07:00
H. Peter Anvin
3e30c32812 nasm: when using -MW, quote filenames containing &
When using the -MW option, double-quote filenames containing &.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 22:20:36 -07:00
H. Peter Anvin
427b9cae8b nasm: when using -MW, enclose whitespace in double quotes
When using the -MW option, enclose whitespace-containing filenames in
double quotes.  There are probably quite a few other things we ought
to know how to do...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 22:17:51 -07:00
H. Peter Anvin
f05034fd58 nasm: when generating null targets for WMAKE, add %null
WMAKE wants an explicit %null directive; empty is not ok.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 22:09:44 -07:00
H. Peter Anvin
ff04a9ffe8 BR 3392421: consider mode decorators in instruction matching
We have to consider mode decorators when considering instruction
matching, otherwise we end up falling back to VEX encoding if it is
available, losing the decorator.  See BR 3392421.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 21:48:52 -07:00
H. Peter Anvin
c2834b9abe nasmdoc: the dbg output format is compiled in by default
These days, the dbg output format is compiled in by default, too.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 21:17:27 -07:00
H. Peter Anvin
77c9bf6cd8 nasm: new option -MW to emit Watcom-style Makefile rules
Allow NASM to generate Watcom-style Makefile dependencies, in addition
to the default POSIX-style Makefile dependencies.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 21:14:33 -07:00
H. Peter Anvin
dd47d57e4d doc/rdsrc: don't treat \# as a comment marker if preceeded by \
We need to be able to let \\# represent a literal \#, rather than
be \ followed by a comment.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 21:13:23 -07:00
H. Peter Anvin
2998226fa1 test/Makefile: output dependency information files
Generate dependency information files as output to make sure we really
do the right thing.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 16:43:04 -07:00
H. Peter Anvin
97fda4ce6e asm/preproc.c: use nasm_add_string_to_strlist()
Use nasm_add_string_to_strlist() to avoid a memory leak.
nasm_add_to_strlist() requires that the caller manages the string
being added or not.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 15:52:51 -07:00
H. Peter Anvin
cf53dfbac4 misc/omfdump.c: expand dDEPFILE COMENT records
Expand dDEPFILE COMENT records.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 15:23:01 -07:00
H. Peter Anvin
a771be85f4 outobj: emit file dependency information
Some OMF toolchain can make use of file dependency information
embedded in the object files.  As implemented here, we don't try to
absolutize the filenames, as that prevents moving around trees and is
OS-dependent.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 15:00:38 -07:00
Martin Storsjö
f283c8f5c2 preproc: Add found files to the list of dependencies even when cached
This fixes the dependency listings as generated with -MD (if
assembling runs in multiple passes).

https://bugzilla.nasm.us/show_bug.cgi?id=3392420

gorcunov@: add missing zero byte

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 14:59:40 -07:00
Cyrill Gorcunov
d7a5473368 configure: Add --enable-gdb option
When one needs to run nasm under GDB

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 14:59:25 -07:00
Cyrill Gorcunov
750048723e preproc: Free token's text if only it has been modified
https://bugzilla.nasm.us/show_bug.cgi?id=3392414

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 14:59:15 -07:00
Adam Majer
91e72409be preproc: Workaround a usage after free bug
In some circumstantes this free is incorrect resulting
in usage after-free. Workaround it by not freeing memory
here.

https://bugzilla.nasm.us/show_bug.cgi?id=3392414

gorcunov@:
 - slightly tuneup the comment

Signed-off-by: Adam Majer <amajer@suse.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 14:59:04 -07:00
Adam Majer
1a069438ef preproc: Only concat tok->text if we accounted for its size
https://bugzilla.nasm.us/show_bug.cgi?id=3392415

Signed-off-by: Adam Majer <amajer@suse.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 14:58:53 -07:00
H. Peter Anvin
24f7b5c3e4 timestamp: centralize handing of compilation timestamp
Do all the generation and conversion of the compiler timestamp in one
place and make it available to modules.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-02 18:37:54 -07:00
Cyrill Gorcunov
f7e39739c3 nasmlib/md5c: Fix typo in WORDS_LITTLEENDIAN
https://bugzilla.nasm.us/show_bug.cgi?id=3392416

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2017-06-25 19:33:14 -07:00
H. Peter Anvin
92a8326f0d test/Makefile: separate NASM and NASMDEP
Separate out the NASM and NASMDEP variables, in case one wants to
override the former.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-06-25 19:32:41 -07:00
H. Peter Anvin
df1eec0315 saa: fix typo: LITTEENDIAN -> LITTLEENDIAN
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-06-23 14:39:12 -07:00
H. Peter Anvin
58d2ab176f outmacho: always use symbol-relative relocations for MachO64
It seems that the MachO64 linker really doesn't like segment-relative
relocations under certain circumstances, so force relocations to be converted
to "external" (symbol-relative); error out if no symbol is available
(if this is a problem, we can consider inserting a synthetic symbol if
necessary.)

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-06-22 23:36:34 -07:00
H. Peter Anvin
1669cb04a5 outdbg: make the output for relative relocations more clear
Make the output for relative relocations more clear, so it can be
actually comprehended.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-06-22 23:00:38 -07:00
H. Peter Anvin
8a6903c43d test/reldef.asm: add some global symbols
Make some symbols global for more testing.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-06-22 18:39:52 -07:00
H. Peter Anvin
f61dd0fdbb reldef.asm: add more test cases for reference
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-06-22 18:32:49 -07:00
H. Peter Anvin
37b9be3402 reldef.asm: more comprehensive test
More testing of various relative operations.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-06-22 18:20:44 -07:00
sezeroz
2987e5d90e BR 3392409: idata_bytes() and resv_bytes() don't match their prototypes
https://bugzilla.nasm.us/show_bug.cgi?id=3392409

idata_bytes() and resv_bytes() don't match their prototypes in common.c
which leads to a build error with watcom.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-06-01 15:23:05 -07:00
H. Peter Anvin
4be9b5790d nasmdoc.css: add more space between columns and a column separator
The columns were rather crammed together; add more space around them
and add a column separator bar.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-02 13:09:49 -07:00
H. Peter Anvin
735883692d Document/update dependencies for the documentation
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-02 13:01:59 -07:00
H. Peter Anvin
13ff7f92ec NASM 2.13.01 2017-05-01 22:17:48 -07:00
H. Peter Anvin
7c99db15f0 insns.h: change ITEMPLATE_END to not warn on some compilers
The use of negative numbers for some fields in ITEMPLATE_END triggers
a nuisance warning at least with Sun CC.  There is no reason for it:
the only thing that matters in this template is I_none, so declare it
that way.

See BR 3392372.

Reported-by: <noloader@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 22:06:58 -07:00
H. Peter Anvin
4892f95bb5 doc/changes.src: update with the latest changes
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 21:16:21 -07:00
H. Peter Anvin
3e458a89d8 a) Fix handling of DZ/ZWORD; b) don't crash on TIMES JMP
a) Fix a number of missing instances of DZ and ZWORD.

b) NASM would crash if TIMES was used on an instruction which varies
   in size, e.g. JMP.  Fix this by moving the handling of TIMES at a
   higher level, so we generate the instruction "de novo" for each
   iteration.  The exception is INCBIN, so we can avoid reading the
   included file over and over.

c) When using the RESx instructions, just fold TIMES into the reserved
   space size; there is absolutely no point to iterate over it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 21:13:15 -07:00
H. Peter Anvin
5810c594c9 listing: fix base address for TIMES
A simpler, and actually correct fix for the listing address for
TIMES.  The listing interface is quite frankly insane, but it probably
is better to fix it in 2.14+ and not in the maintenance branch.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 19:51:09 -07:00
H. Peter Anvin
5f93c9597d Revert "asm/assemble.c: correct the listing address for TIMES"
This reverts commit 440ba7e13e.

The fix is wrong; it causes the listing file to *only* show <rept>,
without showing the first iteration.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 19:44:34 -07:00
H. Peter Anvin
3301ee8a9e doc/changes.src: document the changes to the 2.13 maint branch so far
Current changes scheduled for 2.13.01.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 15:41:30 -07:00
H. Peter Anvin
440ba7e13e asm/assemble.c: correct the listing address for TIMES
We need to set the listing offset before calling LIST_TIMES, but we
had already advanced data.offset by calling out().  Move the call to
lfmt->set_offset() and lfmt->uplevel() to the top and out of the loop;
there is no reason for it to be in the loop in the first place.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 15:39:15 -07:00
H. Peter Anvin
571592ea63 listing.c: show [ssss] for a segment instead of a bogus address
There is no point in showing a number of a relative segment, so just
show [ssss]; even if there is a possible segment offset it is
linker-dependent and output format dependent.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 15:32:37 -07:00