summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* preproc: add %(i)defid, fix %(i)deftok code manglingextnamesH. Peter Anvin (Intel)2018-06-252-7/+78
| | | | | | | | | | | The previous checkin really got the code for %(i)deftok messed up; this is fixed. Add %(i)defid which works like %(i)deftok, except that the string being input is mangled in such a way that it always results in a valid NASM identifier. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: make %(i)deftok a bit more flexibleH. Peter Anvin (Intel)2018-06-251-18/+26
| | | | | | | Make %(i)deftok capable of handling more than one input string, and allow unquoted strings, a.k.a. bare tokens. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* nasmlib: add nasm_strappend()H. Peter Anvin (Intel)2018-06-252-0/+20
| | | | | | | | nasm_strappend() is similar to nasm_strcat() for the case where the first string isn't useful and should be freed. Furthermore, one or both of the arguments are allowed to be NULL. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* quote: revert preprocessor behaviorH. Peter Anvin (Intel)2018-06-252-3/+20
| | | | | | | | | | Revert the preprocessor to the previous behavior (any non-NUL character permitted); this allows us to make nasm_unquote_cstr() reject any control character, too. Do make nasm_unquote_pp() at least warn on an unterminated string. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* asm/directiv.c: move "special" in with the other symdef variablesH. Peter Anvin (Intel)2018-06-251-5/+3
| | | | | | | Handle the string pointer "special" just like the other symdef parsing variables (mangled, sizestr). Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* asm/directiv.c: remove unnecessary call to nasm_skip_spaces()H. Peter Anvin (Intel)2018-06-251-1/+1
| | | | | | We have just make sure nasm_skip_spaces() was called right above it. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* labels: global/common/extern/static can now force the external nameH. Peter Anvin (Intel)2018-06-254-14/+38
| | | | | | | | | | | | Add an option to the global/common/extern/static directives to force the external name to be used for a label. The syntax is: GLOBAL symbol "external_name" ... where "external_name" is any NASM quoted string without control characters. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* quote: move nasm_unquote_cstr() to quote.c; disallow control charactersH. Peter Anvin (Intel)2018-06-253-18/+52
| | | | | | | | | | Move nasm_unquote_cstr() to quote.c so we can use it in other places. Provide nasm_unquote_pp() as a minimal wrapper for the preprocessor itself. Disallow non-ASCII characters except tab in the output. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* doc: add a few more updatesH. Peter Anvin (Intel)2018-06-252-22/+22
| | | | | | In particular, document the new behavior of EXTERN, GLOBAL and COMMON. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* insns.dat: V4F(N)MADDSS are .lig not .512H. Peter Anvin (Intel)2018-06-251-2/+2
| | | | | | These instructions ignore vector length. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.14rc10nasm-2.14rc10H. Peter Anvin2018-06-251-1/+1
|
* insns.dat: fix the opcodes for the V4FNM* instructionsH. Peter Anvin2018-06-251-2/+2
| | | | | | The two V4FNM* instructions had the wrong opcodes. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.14rc9nasm-2.14rc9H. Peter Anvin2018-06-251-1/+1
|
* asm: support the +n syntax for register setsH. Peter Anvin2018-06-256-18/+82
| | | | | | | Support the +n syntax for multiple contiguous registers, and emit it in the output from ndisasm as well. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* insns.dat: add support for the V4* and VP4* 4-way instructionsnasm-2.14rc8H. Peter Anvin (Intel)2018-06-252-0/+12
| | | | | | | | | | New instructions which do four full iterations of a data-reduction operation (FMA, dot product.) Bug report: https://bugzilla.nasm.us/show_bug.cgi?id=3392492 Reported-by: ff_ff <qqqqqqqqqfffffffff@gmail.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* insns.dat: add PTWRITE instructionH. Peter Anvin (Intel)2018-06-251-0/+4
| | | | | | | | | Add PTWRITE instruction. It is worth noting that we should be able to do "ptwrite [eax]" in 32-bit mode, but the instruction selector doesn't currently handle that well in a way that doesn't make 64-bit mode very confusing. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* changes.src: cleanup and fixesH. Peter Anvin (Intel)2018-06-251-15/+17
| | | | | | | Clean up the language somewhat, and fix a couple of confusing statements. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* doc: 2.14 change logChang S. Bae2018-06-252-1/+48
| | | | | Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* doc: document new feature from version 2.14Chang S. Bae2018-06-251-6/+139
| | | | | | | | | Added descriptions about new commandline options, STATIC directive, symbol mingling, and some output format specifics. Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* nasm: fix some typo and description for the option helpChang S. Bae2018-06-251-4/+6
| | | | | Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.14rc8H. Peter Anvin (Intel)2018-06-251-1/+1
|
* absolute: in absolute space, need to use absolute.segmentH. Peter Anvin (Intel)2018-06-252-1/+3
| | | | | | | | | We can be in absolute space and still end up with segment-relative references. This is in fact the meaning of absolute.segment. Make sure we define the labels appropriately. Reported-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* test: make absolute.asm buildable even when not in binary modeH. Peter Anvin, Intel2018-06-251-3/+4
| | | | | | | absolute.asm is useful even for other backends, so explicitly test to see if ORG is possible for this format. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* test: add test for context-local labels and extern label promotionH. Peter Anvin, Intel2018-06-251-0/+25
| | | | | | | | Add a simple test case for context-local (%$) labels not disturbing the local variable namespace, and extern labels getting promoted to global. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* labels: auto-promote EXTERN labels to GLOBAL if definedH. Peter Anvin, Intel2018-06-251-1/+7
| | | | | | | | | | If we define a label which was previously declared EXTERN, then automatically treat is as GLOBAL. Previously, we would fail to converge and loop forever, which is obviously not what we want. This is more user-friendly anyway. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* labels: if we have overridden EXTERN, don't call define_label()H. Peter Anvin, Intel2018-06-251-1/+1
| | | | | | | | | If we have overridden EXTERN, then we should not call define_label() on it again. Return a fail status from declare_label(), indicating that the type declaration failed, but of course we don't print an error message. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* labels: fix formatting of warning messageH. Peter Anvin, Intel2018-06-251-2/+2
| | | | | | Output was backwards... Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* nasm: need to call init_labels() before command line parsingH. Peter Anvin, Intel2018-06-251-7/+7
| | | | | | | | The prefix and suffix options call perm_alloc() in labels.c, which is not available until init_labels() have run. There is no reason not to call init_labels() early. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* labels: don't update the local variable base for *ANY* dot labelsH. Peter Anvin, Intel2018-06-251-10/+22
| | | | | | | | | | | | | ..@ labels (macro-local) are NASM specials, although not "magic": they are explicitly defined to not preturb the local label base name. However, they return false for both islocal() and ismagic(), so we need to add a new function containing the correct test for when the local label base should be advanced. Reported-by: <balducci@units.it> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Bae, Chang Seok <chang.seok.bae@intel.com>
* NASM 2.14rc7nasm-2.14rc7H. Peter Anvin2018-06-181-1/+1
|
* RAA: make pointer vs integer RAAs type safeH. Peter Anvin2018-06-183-52/+76
| | | | | | | Use pseudo-types to make it impossible to confuse RAAs made of integers and RAAs made of pointers. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* outmacho: don't use raa_read() for pointer valuesH. Peter Anvin2018-06-181-1/+1
| | | | | | | If we write pointers, we have to read pointers. This unbreaks non-64-bit bigendian systems. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* labels: pass the mangled name to the backend for fixupsH. Peter Anvin2018-06-181-1/+1
| | | | | | | ofmt->symdef() always takes the mangled label name, make sure we actually do the correct thing even for forward fixups. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* NASM 2.14rc6nasm-2.14rc6H. Peter Anvin2018-06-181-1/+1
|
* Makefile.in: fix building RDOFFH. Peter Anvin2018-06-181-1/+1
| | | | | | | Apparently it isn't just NMAKE which is sensitive to the ordering of .SUFFIXES, it apparently applies just as well to Unix make. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* MSVC: fix dependency generation and building RDOFF under MSVCH. Peter Anvin2018-06-183-47/+41
| | | | | | | | | | | | 1. The mkdep.pl program didn't handle excluded dependencies correctly, causing it to error out due to config/config.h not existing. 2. NMAKE is sensitive to the order suffixes appear in .SUFFIXES, causing it to try to use the builtin rule .c.exe instead of .c.obj -> .obj.exe. 3. NMAKE doesn't handle the && operator between commands. 4. The !ifdef jungle around dependency generation was wrong. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* .gitignore: add asm/directbl.hH. Peter Anvin2018-06-181-0/+1
| | | | | | | asm/directbl.h was missing from .gitignore, making this generated file show up as a file not checked in. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* test: test for ELF symbol visibilityH. Peter Anvin2018-06-181-0/+10
| | | | | | Add test for declaring ELF visibility. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* pragma: define a hander for generic output (and debug) pragmasH. Peter Anvin2018-06-183-14/+25
| | | | | | | | | There are cases where we may want to implement generic pragmas, while still make them selective based on output and/or debug formats. Initially, use this for the prefix/suffix options. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Cc: Chang Seok Bae <chang.seok.bae@intel.com>
* test/Makefile: qualify the names of list files with output formatH. Peter Anvin2018-06-181-15/+15
| | | | | | | It is quite likely we may want to build the same input with multiple output formats; make it so we don't lose the list file. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* nasm.h: remove unused constantsH. Peter Anvin2018-06-181-8/+0
| | | | | | Remove unused constants for prefix and suffix, long since obsolete. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* NASM 2.14rc5nasm-2.14rc5H. Peter Anvin2018-06-161-1/+1
|
* insns.dat: update with instructions from ISE 319433-034H. Peter Anvin2018-06-162-3/+138
| | | | | | | Add instructions from the Intel Instruction Set Extensions and Future Features Programming Reference, document 319433-034, May 2018. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Make limits 64 bits, add globallines limit to configurable limitsH. Peter Anvin2018-06-155-23/+27
| | | | | | | | Make all limit counters 64 bits, in case someone really has a usage for an insanely large program. The globallines limit was omitted, add it to the list of configurable limits. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Makefile.in: remove duplicated $(ALL_CFLAGS)H. Peter Anvin2018-06-151-3/+3
| | | | | | We really don't need every C compiler flag repeated twice. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge commit '7daa26f9ba3ca45813d16ce540564448c13b16fa' into nasm-2.14.xxH. Peter Anvin2018-06-153-2/+6
|\ | | | | | | | | | | | | Merge in some warning workarounds/possible bugs discovered by a recent gcc. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * gcc: fix mistakes discovered by recent gccH. Peter Anvin2018-06-022-2/+3
| | | | | | | | | | | | | | Recent versions of gcc issue a couple of warnings, which may be real bugs. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * gcc: newer gcc trip on -Wstringop-truncation for valid uses of strncpy()H. Peter Anvin2018-06-021-0/+3
| | | | | | | | | | | | | | | | strncpy() is correctly used to fill in a zero-*padded* (not zero-terminated) field in several places. Make gcc not complain about those uses. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | NASM 2.14rc4nasm-2.14rc4H. Peter Anvin2018-06-141-1/+1
| |
* | labels: allocation of a segment number counts as a changeH. Peter Anvin2018-06-141-5/+2
| | | | | | | | | | | | | | | | If we allocate a new segment number, that has to cause global_offset_changed to be incremented. Thus, we should not update lptr->defn.segment until that would ordinarily be done. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>