The OUT_REL*ADR types pass a pointer which points to an int64_t
which then should be truncated down to size. This matters on
bigendian platforms.
Add OUT_REL8ADR.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The documentation uses "Intel hex", with that capitalization (Intel
being a proper noun, hex being descriptive) so make the help message
match.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Revert to original %+ behavior. This is what we really wanted in the
first place, except this time we have fixed some bugs.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Revert to the earlier behavior of not expanding %+ until the final
phase of smacro expansion. However, the previous code has:
if (expanded && paste_tokens(&thead, true)) {
... which would inhibit paste_tokens() if expanded was false on the
first iteration. However, if expand_mmac_params is not expanding %+,
then we cannot bypass this expansion. Thus use:
pasted = paste_tokens(&thead, true);
if (expanded && pasted) {
... instead.
This seems to work with both Syslinux and x264 usage, and therefore
hopefully should be compatible with earlier versions of NASM.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Update user-visible changes so far. Since I consider the license
change alone to be big enough of a deal to justify a "real" version
number, make this version 2.07.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
*To the best of my knowledge*, we now have authorization from everyone
who has significantly contributed to NASM in the past. As such,
change the license to the 2-clause BSD license.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
- add assert so we don't try to write 2^64 bytes of zero
- explicitly track the Intel hex "LBA" (64K page) instead of playing
games with the last byte written. This way it is more explicit
what we're doing and why.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
BR 677841 was fixed backwards, with a reverse condition. Correct the
direction of the fix, and add an assert for the overflow condition.
Note: the bug was non-manifest in previous build, so this is not a
security issue.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
In the "NASM shell", it makes sense for NASM to be first in the PATH,
not last. That way if the user has more than one version of NASM
installed, and one of them is global, the "NASM shell" for any one
version will still pick up the proper version.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Change the "noreturn" macro to "no_return", to avoid problems with
system header files which use __attribute__((noreturn)) rather than
__attribute__((__noreturn__)) as is appropriate for system headers.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Consider that argv[0] may contain extensions like .exe as well as
pathname prefixes. Handle it by searching backwards for the string
"rdf2" and then extract the alphanumeric tail that follows.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
We seem to use the term "extensions" to mean anything that is specific
to an object format, so continue to do so.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Using saa_fpwrite() to dump a section to a file automatically does
saa_rewind(), but if we use saa_rnbytes() to do bit by bit then we
manually need to to saa_rewind() before we start.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add support for directly generating Intel hex or Motorola S-records.
These formats are commonly used with ROM burners.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Allow the backend to specify that an output format is either text or
binary. For future uses, define this as a flag word so we can define
other flags in the future if it would make sense.
Currently, the ieee and dbg formats are text; all the others are
binary.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
We explicitly want the compiler to pessimize the taken case of the
assert, so unlikely() is appropriate here.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The more common acronym for Intel Hex seems to be "ith", but the
legacy utility was "rdf2ihx", so we allow both variants. However, the
Makefile rule was wrong.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Make the base addresses in rdfload unsigned. Note: this file is
really obsolete; it can't represent RDF2 with more than the 3
old-style segments.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Remove rdf2ihx.c since I think it's unlikely we'll ever get it
relicensed -- any attempts at contacting the author has failed, and
it's easier to reconstruct it from scratch.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Beginnings of a crude utility to dump the contents of an OMF (obj)
file. At this point all it does it breaks it down into the individual
records and dumps those, but it is still easier to read than a pure
hexdump.
See http://www.azillionmonkeys.com/qed/Omfg.pdf for the format spec.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Fix report_error() to (hopefully) not fault if used without ERR_NOFILE
if no filename is available.
Avoid nuisance phase error between passes warnings if we have detected
other errors. In those case, the phase error is almost certainly
spurious.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
SEG <undefined> can happen, validly, for a common symbol during the
optimization passes. It better not happen during the real passes,
however!
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add new nasm_assert() function, and add "const" to the declarations
which take filenames, as well as to the nasm_strdup/strndup functions.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Received authorization from Apple to change the license of outmacho.c
to the 2-clause BSD license. Thanks!
Signed-off-by: H. Peter Anvin <hpa@zytor.com>