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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The legacy output doesn't distinguish between segments and other
addresses, so we need to force the offset to zero before passing it
down to the output layer.
This addresses BR 3392406.
Reported-by: <rugxulo@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Create directory table in prologue and file name indicates index
of the table for its directory
Now bring back included file names
Signedoff-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Separate dir info from the file list to align with dwarf format
in debug_line section
Signedoff-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Win32::Registry is obsolete, we need to use Win32::TieRegistry on
current platforms.
GhostScript uses # rather than = on Windows, it seems.
Try to find GhostScript in the registry and add it to the PATH.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Fix a construct in doc/findfont.ph which crashes Perl on Windows
unconditionally.
Improve the README for building the full package with MSVC.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
In debug info and line, only main source is showed up. Header files
will be laid out via TAG_subprogram
Included missing memory cleanups
Removed unnecessary null assertions
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add __MACH__ as a Unix-like system (e.g. MacOS X defines __MACH__ but
no variant of __unix__.)
Fix a reversed test in first_filename_char().
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>