Commit Graph

1784 Commits

Author SHA1 Message Date
H. Peter Anvin
8a962b3efd BR 2822263: don't re-invoke ofmt->symdef() in pass2 unless "special"
Before checkin aeb0e0e9f1 we would only
invoke ofmt->symdef() for a common variable during pass 2 if that
variable had "special" in the declaration.  That checkin
unintentionally changed that behavior.

That doesn't mean that the pre-existing behavior is right, but this
should at least fix the resulting regressions.  This really warrants
more investigation.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-16 22:35:25 -04:00
Keith Kanios
e5b9d2dac0 outform.h: update comments regarding macho32/macho64 2009-07-16 21:13:10 -05:00
H. Peter Anvin
a99c98470e changes: it's not just invalid UTF-8 sequences that are affected...
It isn't just invalid UTF-8 sequences that are affected; it is in fact
any high-bit bytes (we don't ever try to construct UTF-8 characters,
just deconstruct them.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-15 17:43:32 -04:00
H. Peter Anvin
a329a85cdf NASM 2.07rc6 2009-07-15 16:33:25 -04:00
H. Peter Anvin
cc6ee1acf2 changes: document fixed crash on invalid UTF-8 sequences
Document nasm_quote() fixes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-15 16:31:55 -04:00
H. Peter Anvin
252c2db7d9 quote: use nasm_assert() instead of plain assert()
We have nasm_assert() now, so use it...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-15 16:30:30 -04:00
H. Peter Anvin
4d5029dd76 quote: we must do unsigned comparison to get length of octal escape
When computing the length of an octal escape, we need to do an
unsigned compare, otherwise we only allocate space for one character
for bytes in the \200..\377 range, which is obviously incorrect.

Reported-by: Ed Beroset <beroset@mindspring.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-15 16:30:22 -04:00
H. Peter Anvin
b93c1881f6 quote: don't use sprintf()
There is no point in using sprintf(), and it adds the possibility of
either bugs due to the output not matching what the byte count loop is
expecting, or just cause people to freak out due to the notion that
"sprinf is unsafe".

Reported-by: Ed Beroset <beroset@mindspring.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-15 16:30:15 -04:00
H. Peter Anvin
62f2863860 doc: use consistent title case
Section titles are in title case and don't end with a period.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-15 09:27:10 -04:00
H. Peter Anvin
9bd5e12f53 doc: fix formatting of the bin multisection header
"Multisection" is not a keyword...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-15 09:21:01 -04:00
H. Peter Anvin
a758c48c61 NASM 2.07rc5 2009-07-15 09:08:28 -04:00
H. Peter Anvin
44a0d177f0 gitignore: add test results, *.dbg
Add test result directories and *.dbg to gitignore.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-13 21:27:21 -04:00
H. Peter Anvin
2a3154c4d3 ELF: add debug support for TY_YWORD
Add debug support for TY_YWORD (256 bits/32 bytes).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-13 21:25:36 -04:00
Cyrill Gorcunov
e3042cb103 elf32: debug32_typevalue - fix TY_OWORD size
TY_OWORD is 8 * TY_WORD = 16 bytes length

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-13 17:19:21 -04:00
H. Peter Anvin
8da1557a3e NASM 2.07rc4 2009-07-08 21:43:34 -07:00
H. Peter Anvin
a6e25b5356 Document macho64 output format
At least mention the 64-bit macho format in the documentation.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-08 21:42:18 -07:00
Keith Kanios
c5a87ba0a1 Revert "NASM 2.07rc4"
This reverts commit 6d67ced3a4.
2009-07-08 23:28:31 -05:00
Keith Kanios
6d67ced3a4 NASM 2.07rc4 2009-07-08 23:21:28 -05:00
Keith Kanios
6d0d0d2736 macho64: Manually merge macho64 branch with master branch. 2009-07-08 23:04:52 -05:00
Keith Kanios
745560e65a outmacho.c: fix section/relocation alignment issue 2009-07-07 23:09:22 -05:00
H. Peter Anvin
52a3fbd74d NASM 2.07rc3 2009-07-07 16:09:55 -07:00
H. Peter Anvin
a7a14b2fcb changes: document listing fix
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-07 16:08:56 -07:00
H. Peter Anvin
931cab64d6 preproc: revert to older form of preprocessor user error messages
When the user generates an error via %warning, %error, or %fatal,
treat is as any other error message.  The attempt at making them stand
out really looked ugly when the preprocessor adds additional tracing
information.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-07 16:06:21 -07:00
H. Peter Anvin
8287daf2a4 preproc: always reprocess smacros after %+ - pasting
We always need to process %+ at least once, but we also always need to
reprocess smacros after pasting.  The solution to this is to make sure
we always reprocess %+ after the first expansion pass.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-07 16:00:58 -07:00
H. Peter Anvin
a23aa4a3e9 listing: preserve list file on error, include errors
Instead of removing the list file on error, keep the list file and
include the errors in the list file.  This makes it actually possible
to debug things that involve deep macro recursion, where the line
number is pretty much meaningless.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-07 12:04:12 -07:00
H. Peter Anvin
5bc87609d2 outdbg: be excrutiatingly correct...
outdbg is actually a good starting point to make a new backend, so we
really should endeavor to make it do things "right".

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-07 10:27:51 -07:00
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