summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* doc: latex -- Initial importlatexCyrill Gorcunov2019-03-3123-0/+11598
| | | | | | | | | | | | | | | | | | | | | | | | | | It is an initial import for conversion of our documentation to latex format. Note that latex additional packages needs to be preinstalled, xelatex is used for pdf generation. While I've been very carefull while converting the docs there is a big probability that some indices might be screwed so we need to review everything once again. Then we need to create a converter for html backend, I started working on it but didn't successed yet and I fear won't have enough spare time in near future. Also we need to autogenerate instruction table and warnings from insns.dat and probably from scanning nasm sources. To build nasm.pdf just run make -C doc/latex/ it doesn't require configuration and rather a standalone builder out of our traditional build engine. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* preproc: Fix nil dereference on error pathsCyrill Gorcunov2019-03-161-2/+4
| | | | | | https://bugzilla.nasm.us/show_bug.cgi?id=3392562 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* autoconf: move aux directory, define AC_CONFIG_AUX_DIR()H. Peter Anvin2019-02-227-253/+3
| | | | | | | | | | | | | The name "aux" is reserved on Windows platforms, a legacy from CP/M via MS-DOS. Rename it to "helpers". Turns out that that directory wasn't actually used properly, because AC_CONFIG_AUX_DIR was never defined, and there was a redundant copy of install-sh checked into the base of the source tree. Reported-by: Ehsan Alem Mohammad Ghasemlou <e.ghasemloo@gmail.com> NASM-Bugzilla: https://bugzilla.nasm.us/show_bug.cgi?id=3392560 Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* alignb: disable warnings for use in a progbits sectionH. Peter Anvin (Intel)2019-01-111-1/+4
| | | | | | | Allow the alignb directive to be used in either a progbits or a nobits section, by suppressing the zeroing warning. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* warnings: add [warning push] and [warning pop]H. Peter Anvin (Intel)2019-01-118-30/+124
| | | | | | Add [warning push] and [warning pop] directives. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* Warnings: move zeroing reserved space to a separate warning classH. Peter Anvin (Intel)2019-01-119-11/+21
| | | | | | | Zeroing reserved space in a progbits section really should be a separate warning class, so it can be controlled independently. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* tokhash.pl: zero all the fields for a not-found tokenH. Peter Anvin2018-12-291-26/+37
| | | | | | | Make sure we zero all the token fields if we don't find something in the hash. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* tokens.dat: TOKEN_SIZE sizes belong in inttwo, not in flagsH. Peter Anvin2018-12-291-1/+8
| | | | | | | TOKEN_SIZE size values ended up in the wrong place, which caused parser errors due to being mistaken as flags. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* nasmlib.h: clarify the semantics of nasm_aprintf_size()H. Peter Anvin2018-12-271-1/+2
| | | | | | | nasm_aprintf_size() does include the final NUL byte, but does not include any prefix storage allocated by nasm_[v]axprintf(). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Move <strings.h> inclusion to "compiler.h"H. Peter Anvin2018-12-272-4/+3
| | | | | | | | Move the inclusion of <strings.h> from nasmlib.h to compiler.h Try to centralize compiler dependences as much as possible. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Remove #includes already provided by "compiler.h"H. Peter Anvin2018-12-2740-87/+0
| | | | | | | | "compiler.h" already includes a bunch of common include files. There is absolutely no reason to duplicate them in individual files, and in fact it robs us of central control of how these files are used. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Replace <ctype.h> includes with "nctype.h"H. Peter Anvin2018-12-2722-22/+24
| | | | | | | For almost everything we should use "nctype.h". Right now we don't have a nasm_toupper() to use <ctype.h> for things that need toupper(). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge tag 'nasm-2.14.03rc1'H. Peter Anvin2018-12-274-2/+13
|\ | | | | | | | | | | | | | | | | | | NASM 2.14.03rc1 Resolved Conflicts: asm/labels.c include/error.h Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * NASM 2.14.03rc1nasm-2.14.03rc1H. Peter Anvin2018-12-271-1/+1
| |
| * changes.src: document suppressed messagesH. Peter Anvin2018-12-271-0/+5
| | | | | | | | | | | | Document the suppression of error messages from "label changed". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * BR 3392539: some errors can "cascade". Allow suppressing if dead.H. Peter Anvin2018-12-273-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In BR 3392539, the error: helloW.s:18: error: label `rurt' changed during code generation [-w+error=label-redef-late] ... occurs a number of times after we have already issued an error. This is because the erroring instruction computes to a different size during code generation; this causes each subsequent label to cause a phase error. The phase error simply doesn't make much sense to report: if we are already committed to erroring out, it is more likely an error cascade rather than an error in its own right, so just suppress it in that case. Reported-by: <russvz@comcast.net> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Merge tag 'nasm-2.14.02'H. Peter Anvin2018-12-262-0/+32
|\ \ | |/ | | | | | | | | | | NASM 2.14.02 Resolved Conflicts: asm/listing.c
| * NASM 2.14.02nasm-2.14.02Cyrill Gorcunov2018-12-261-1/+1
| |
| * changes.src: document fix for listing module crashH. Peter Anvin2018-12-261-0/+5
| | | | | | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * listing: list_emit -- Don't forget to zap listerr_headCyrill Gorcunov2018-12-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | In list_emit we walk over listerr_head freeing the list, but the head pointer remain carrying old value. Need to clean it up once traverse is done to not access already freed memory later. https://bugzilla.nasm.us/show_bug.cgi?id=3392538 Reported-by: russvz@comcast.net Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| * BR 3392538: test case for double free in listing moduleH. Peter Anvin2018-12-241-0/+27
| | | | | | | | | | | | | | | | | | Test case from bug 3392538 for double free in the listing module. This is the test case only, not a fix. Reported-by: <russyz@comcast.net> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | compiler.h: need to cast a (void *) to (char *) before addingH. Peter Anvin2018-12-261-1/+1
| | | | | | | | | | | | | | | | | | In the implementation of mempcpy(): Doing arithmetic on (void *) isn't permitted, so we need to cast it to (char *); it then get automatically converted to void * by the return. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | nasmlib/ver.[ch]: add "compiler.h"H. Peter Anvin2018-12-262-2/+2
| | | | | | | | | | | | We should use "compiler.h", not just include <stdlib.h> explicitly. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Move <string.h> inclusion to compiler.hH. Peter Anvin2018-12-2646-45/+1
| | | | | | | | | | | | | | There is absolutely no reason not to include <string.h> globally, and with the inline function for mempcpy() we need it there anyway. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Mkfiles: run "make cleandist"H. Peter Anvin2018-12-262-2/+38
| | | | | | | | | | | | Run "make cleandist" to update the file lists. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Test for the mempcpy() function and add alternative if missingH. Peter Anvin2018-12-262-0/+8
| | | | | | | | | | | | | | If memcpy() doesn't exist, then add an inline alternative using memcpy(). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | nasm.spec.in: remove obsolete filesH. Peter Anvin2018-12-261-1/+1
| | | | | | | | README and TODO are deleted and CHANGES is meaningless.
* | TODO: delete completely obsolete fileH. Peter Anvin2018-12-261-376/+0
| |
* | nasm.spec.in: we need *automake*; autoheader is in autoconfH. Peter Anvin2018-12-261-1/+1
| | | | | | | | | | | | | | We need the automake package for autogen.sh; the autoheader program is in the autoconf package. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | nasm.spec.in: need autoheader, use autogen.shH. Peter Anvin2018-12-261-1/+2
| | | | | | | | | | | | We need to use our new autogen.sh, which in turn needs autoheader. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | tools/release: handle new binary filesH. Peter Anvin2018-12-261-4/+9
| | | | | | | | | | | | With the travis tests, we have a lot more binary files to worry about. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Factor out size tokens and annotate with the corresponding sizeH. Peter Anvin2018-12-243-21/+42
| | | | | | | | | | | | | | There is space in the token table to explicitly encode the size corresponding to a size token. We might as well do so... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | elf.h: add relocation numbers for segmented supportH. Peter Anvin2018-12-241-1/+4
| | | | | | | | | | | | | | Add relocation numbers reserved/intended for segmented support in ELF32. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Makefile: make doc depend on warnings.srcH. Peter Anvin2018-12-241-1/+1
| | | | | | | | | | | | warnings.src needs to exist for make doc to work. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | test: nasm-t -- Use plain stderr extension for error streamCyrill Gorcunov2018-12-232-1/+1
| | | | | | | | | | | | Just to unify with other tests Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | test: nasm-t -- Add clzero caseCyrill Gorcunov2018-12-234-0/+51
| | | | | | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | build: Add missing PA_ADD_LDFLAGS helperCyrill Gorcunov2018-12-232-1/+10
| | | | | | | | | | | | Fixes b0121dc312a83ab4912769e36c9f2cbe9493545d Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | Merge tag 'nasm-2.14.01'H. Peter Anvin2018-12-222-0/+29
|\ \ | |/ | | | | | | | | | | | | | | NASM 2.14.01 Resolved Conflicts: version Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * NASM 2.14.01nasm-2.14.01H. Peter Anvin2018-12-221-1/+1
| |
| * insns.dat: accept explicit ax/eax/rax operand to CLZEROH. Peter Anvin2018-12-222-0/+29
| | | | | | | | | | | | | | | | | | AMD documents this instruction with an rax operand. The error behavior implies this is an address-size-sensitive instruction. Add support for specifying the explicit operand, but consistent with normal ndisasm behavior, don't disassemble the implicit operand. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | autogen.sh: add code to re-run configure afterwardsH. Peter Anvin2018-12-222-2/+13
| | | | | | | | | | | | | | Add code to autogen.sh to (re-)run configure, with preserved configuration. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | autoconf: use librarized autoconf setupH. Peter Anvin2018-12-2222-215/+4406
| | | | | | | | | | | | | | I have been setting up a cross-project librarized autoconf setup; use it for NASM as well. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | test: nasm-t -- Add more details into READMECyrill Gorcunov2018-12-201-7/+69
| | | | | | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | assemble_file(): break up this gigantic messH. Peter Anvin2018-12-182-176/+209
| | | | | | | | | | | | Break up this gigantic mess which touches way too many layers. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Makefile.in: add target for running travisH. Peter Anvin2018-12-181-0/+5
| | | | | | | | | | | | Just like "make test", add "make travis". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Don't convert the various RESx instructions to RESBH. Peter Anvin2018-12-183-19/+9
| | | | | | | | | | | | | | All it does is complicate things; instead leave the opcode where it is. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | With buffered warnings, change the handling of error passesH. Peter Anvin (Intel)2018-12-1815-89/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With buffered warnings, most warnings *must* be issued on every pass, so ERR_PASS1 is simply wrong in most cases. ERR_PASS1 now means "force this warning to be output even in pass_first(). This is to be used for the case where the warning is only executed in pass_first() code; this is highly discouraged as it means the warnings will not appear in the list file and subsequent passes may make the warning suddenly vanish. ERR_PASS2 just as before suppresses an error or warning unless we are in pass_final(). Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* | Merge remote-tracking branch 'origin/nasm-2.14.xx'H. Peter Anvin (Intel)2018-12-181-2/+5
|\ \ | |/
| * test/Makefile: add .aout targetH. Peter Anvin (Intel)2018-12-181-2/+5
| | | | | | | | | | | | We had no target for generating an aout format file. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* | Clean up the handling of various passesH. Peter Anvin (Intel)2018-12-1822-299/+353
| | | | | | | | | | | | | | | | | | The use of pass0, pass1, pass2, and "pass" passed as an argument is really confusing and already caused a severe bug in the 2.14.01 release cycle. Clean them up and be far more explicit about what various passes mean. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>