Commit Graph

1808 Commits

Author SHA1 Message Date
H. Peter Anvin
62c0e8379c outdbg: fix OUT_REL*ADR, add OUT_REL8ADR
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>
2009-07-07 10:24:52 -07:00
H. Peter Anvin
215086ace8 outbin: be consistent in spelling "Intel hex" with those caps
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>
2009-07-06 23:37:00 -07:00
H. Peter Anvin
75639312f0 NASM 2.07rc2 2009-07-06 19:28:00 -07:00
H. Peter Anvin
e227fe6f80 changes: add Mach-O alignment issue fix
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-06 19:27:33 -07:00
Keith Kanios
4e56ad2c09 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm 2009-07-06 21:08:12 -05:00
Keith Kanios
5051c63d7e outmacho: fixed section/relocation alignment issue 2009-07-06 21:07:15 -05:00
H. Peter Anvin
83b942d3e1 changes: document %+ behavior revert
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>
2009-07-06 19:00:08 -07:00
H. Peter Anvin
fc30f8c736 preproc: don't handle %+ until the final phase of smacro expansion
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>
2009-07-06 18:48:23 -07:00
H. Peter Anvin
740df43005 NASM 2.07rc1 2009-07-06 11:29:19 -07:00
H. Peter Anvin
fba06d2719 changes.src: document user-visible changes
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>
2009-07-06 11:28:12 -07:00
H. Peter Anvin
ecfba9d6ab doc: update license and contact information
Update license information to 2-BSD; update contact information.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-06 11:22:58 -07:00
H. Peter Anvin
460a4fef3a spec: change License to BSD
The appropriate License tag for the 2-clause BSD license is... wait
for it... "BSD".  Make it so.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-06 11:14:38 -07:00
H. Peter Anvin
4ea9cede34 nasm.nsi: remove COPYING; add LICENSE
The licensing information has been moved into file LICENSE.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-06 11:10:42 -07:00
H. Peter Anvin
8ee2e244eb NASM: relicense under the 2-clause BSD license
*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>
2009-07-06 11:09:11 -07:00
H. Peter Anvin
0bc3bf61db outbin: minor cleanups
- 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>
2009-07-06 10:58:37 -07:00
H. Peter Anvin
565be91fb7 BR 2817225: don't overrun a permts buffer with a maximum label
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>
2009-07-05 22:15:57 -07:00
H. Peter Anvin
5cc5589b73 nasm.nsi: in the "NASM shell", put NASM first in PATH
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>
2009-07-05 19:33:41 -07:00
H. Peter Anvin
84280bbf88 Change noreturn macro to no_return to avoid header file problems
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>
2009-07-05 19:22:28 -07:00
H. Peter Anvin
86eb8b057f nasm.nsi: use LZMA compression
Using LZMA compression produces a significantly smaller installer
binary.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05 19:17:07 -07:00
H. Peter Anvin
7ae512b5a8 More "make install" fixes... 2009-07-05 18:48:50 -07:00
H. Peter Anvin
2fa822b3b3 rdf2bin: be smarter about extracting the format from argv[0]
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>
2009-07-05 18:31:33 -07:00
H. Peter Anvin
3692a63e0c nasm.nsi: add additional rdf2bin aliases
Add additiona rdf2bin aliases to nasm.nsi

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05 18:24:30 -07:00
H. Peter Anvin
662b3fe3a4 rdoff: fix "make install"
Fix "make install" for the new rdf2bin aliases.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05 17:08:46 -07:00
H. Peter Anvin
fd18c5c42b test/Makefile: add ith and srec targets
Add ith and srec targets because, well, why not...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05 16:14:33 -07:00
H. Peter Anvin
224c9ac063 doc: S-records seems to usually be pluralized
Call it "S-records" not "S-record".

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05 15:46:42 -07:00
H. Peter Anvin
d78fc550b8 doc: srec produces S-records, not Intel hex...
Copy and paste accident...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05 15:45:45 -07:00
H. Peter Anvin
fc87e65aec doc: use the term "extensions" to mean of-specific anything
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>
2009-07-05 15:44:38 -07:00
H. Peter Anvin
8a3686287d doc: fix capitalization
Consistently capitalize NASM.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05 15:43:23 -07:00
H. Peter Anvin
ffe782a322 outbin: when using saa_rnbytes() we have to saa_rewind()
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>
2009-07-05 15:40:45 -07:00
H. Peter Anvin
31f336183c outbin: when writing S-records, write head record
When writing S-record output, we should write the head record (S0),
too.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05 15:32:14 -07:00
H. Peter Anvin
4660a2b4a0 outbin: add support for Intel hex and Motorola S-records
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>
2009-07-05 15:29:55 -07:00
H. Peter Anvin
0cba107579 Make it possible for outputs to be either text or binary
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>
2009-07-05 14:45:12 -07:00
H. Peter Anvin
fe1ca5a09f nasmlib.h: add unlikely() to nasm_assert()
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>
2009-07-03 22:55:51 -07:00
H. Peter Anvin
7f2c476297 rdf2bin.1: add missing space
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-03 22:36:03 -07:00
H. Peter Anvin
06c05ae72a rdoff/test/Makefile: actually do build tests
Add actual Makefile rules for the rdoff tests.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-03 21:19:37 -07:00
H. Peter Anvin
20c1d4136d spec: update specfile with new rdf2bin aliases
Update the specfile to contain the new rdf2bin aliases and their man
pages.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-03 21:12:05 -07:00
H. Peter Anvin
a0374589aa rdf2bin: update man page, add link pages for aliases
Update the rdf2bin man page; add link man pages for the various
command aliases.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-03 21:11:21 -07:00
H. Peter Anvin
80c0ba7b0b Add rdf2ith and rdf2srec to .gitignore 2009-07-03 21:04:30 -07:00
H. Peter Anvin
c1f13fc80f Correct the legacy name rdf2ihx (as opposed to rdf2ith)
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>
2009-07-03 21:02:33 -07:00
H. Peter Anvin
1e5b102109 rdf2bin: revamp so it can output bin, ith, or srec
Revamp rdf2bin so it can output binary, Intel hex, or Motorola
S-records.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-03 15:30:48 -07:00
H. Peter Anvin
099f05dce4 rdfload: make the base addresses unsigned
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>
2009-07-03 15:28:45 -07:00
H. Peter Anvin
6c98ca4ddc Remove rdf2ihx.c, since it looks unlikely we'll get it relicensed.
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>
2009-07-03 13:40:57 -07:00
H. Peter Anvin
a8db5089b4 Correction: preproc.c is *not* in the clear just yet.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-03 13:39:25 -07:00
H. Peter Anvin
460d0c817b NASM 2.06.01rc1 2009-07-02 14:32:43 -07:00
H. Peter Anvin
5a11f59a82 Beginnings of a crude utility to dump the contents of an OMF file
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>
2009-07-01 23:11:15 -07:00
H. Peter Anvin
48ef41957a Fix early report_error(); avoid nuisance phase warnings
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>
2009-07-01 22:12:59 -07:00
H. Peter Anvin
d3544ff534 outobj: handle the case of SEG <undefined> in pass 0
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>
2009-07-01 22:04:11 -07:00
H. Peter Anvin
807bed5ffd nasmlib: add nasm_assert(); use const char * for filenames
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>
2009-07-01 22:02:54 -07:00
H. Peter Anvin
396e6dcc4b compiler.h: new macro for a non-returning function
Add a new macro for a non-returning function.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-01 22:01:07 -07:00
H. Peter Anvin
8beadd4da8 outmacho: change license to 2-BSD
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>
2009-06-30 21:17:07 -07:00