summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* New NSIS scriptnsis2Cyrill Gorcunov2009-09-143-0/+200
| | | | | | | | | | Lets start using new NSIS features like Modern UI2, Multiuser install. The file named nasm2.nsi by purpose -- we should _not_ break existing functionality. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* elf,stabs: stabs32/64_generate -- append ending tokenCyrill Gorcunov2009-09-142-16/+19
| | | | | | | | | | | | | | This represent "end of compilation unit" token. Since gcc does (almost) the same lets be on the same side. Though to be precise gcc puts offset which points to the first byte right after the last instruction issued but in fact string index is analyzed only so we may safely write zero here (without relocation as well). Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/elfcommon.h: tab/space cleanupCyrill Gorcunov2009-09-061-111/+111
| | | | | | No change on binary level Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/outelf32.c: code style simplificationCyrill Gorcunov2009-09-031-115/+108
| | | | | | | | | | | | | | | 1) nasm_free is safe against NULL passed so call it without test 2) dwarf32_output: check for debug_immcall early and get out of procedure if success. This allow us to move code blocks left removing indents. 3) dwarf32_findfile and dwarf32_findsect: no need for 'else' when 'if' target is plain return. Move code blocks left removing indents. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/outelf32.c: tab-space cleanupCyrill Gorcunov2009-09-031-390/+367
| | | | | | Together with a small style nitpicking. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/elf64.h: tab-space cleanupCyrill Gorcunov2009-09-031-51/+51
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/elf32.h: tab-space cleanupCyrill Gorcunov2009-09-031-13/+13
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/outelf.h - tab-space cleanupCyrill Gorcunov2009-09-031-23/+23
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Use I_none opcode instead of hardcoded numberCyrill Gorcunov2009-08-232-19/+19
| | | | | | | | Consolidate I_none opcode to be used everywhere instead of mix (-1,I_none). Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Use fputs instead of fprintf for plain stringsVictor van den Elzen2009-08-133-3/+3
| | | | LLVM's Clang warns about this. outieee.c had a real problem.
* Fix some format strings for nasm_errorVictor van den Elzen2009-08-117-21/+27
| | | | | Added a format attribute to nasm_error (only for GCC) and used the resulting warnings to fix some format strings.
* output/dwarf.h: update dwarf constantsCyrill Gorcunov2009-08-101-23/+530
| | | | | | | | | There is a hope we'll be supporting dwarf in full form in future. So I've encoded the standard constants (though binutils uses some additional codes). Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add strlcpy() functionH. Peter Anvin2009-08-108-42/+104
| | | | | | | Add strlcpy() function and implementation, and use configure to detect if strlcpy() is natively available on the system. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* output: change null_debug_routine to null_debug_directiveH. Peter Anvin2009-08-094-5/+5
| | | | | | | This is the null implementation of the function debug_directive. For some reason it ended up getting mangled as "null_debug_routine". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* disasm.c: eatbyte -- use snprintf to prevent potential buffer overflowCyrill Gorcunov2009-08-091-1/+1
| | | | | | | | At moment we can't overrun buffer even if we would like to but better to stay on a safe side and use snprintf. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* headers/c: strip off useless spacesCyrill Gorcunov2009-08-091-2/+2
| | | | | | | | All other templates do not have them so lets unify the approach. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* insns.pl: remove redundant empty line in enum opcodeCyrill Gorcunov2009-08-081-1/+1
| | | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* nasm.c: fix stack overrun in assemble_fileH. Peter Anvin2009-08-081-15/+31
| | | | | | | | | | | | If [DEBUG id] has id longer then 80 symbols (well, 79 actually plus EOS) then stack will be just overwritten. Fix it with explicit check for identifier being too long. Based on an initial version by Cyrill Gorcunov <gorcunov@gmail.com>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com>
* Merge commit 'cyr/hpa-dat'H. Peter Anvin2009-08-071-820/+820
|\
| * insns.dat -- convert FMA instructionsCyrill Gorcunov2009-08-071-192/+192
| | | | | | | | | | | | Convert FMA instructions to explicit sized ones. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| * insns.dat -- convert AVX instructions part2Cyrill Gorcunov2009-08-071-347/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | Convert Intel AVX instructions to explisit size format. Part 2. Also CLMUL converted as well. Btw, VPINSR was a bit broken since SB constraint is not applied on all forms but requires 16,32,64 memory sizes too. Fixed. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| * insns.dat -- convert AVX instructions part1Cyrill Gorcunov2009-08-071-281/+281
| | | | | | | | | | | | | | | | | | Convert Intel AVX instructions to explisit size format. Part 1. Also SAR instruction is touched as well. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | Merge commit 'cyr/hpa-list'H. Peter Anvin2009-08-071-15/+15
|\ \
| * | output/outbin.c -- use list helpersCyrill Gorcunov2009-08-011-15/+15
| |/ | | | | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | doc: \ needs to be repeated except in \c-line context; daily snapshotsH. Peter Anvin2009-08-021-5/+7
|/ | | | | | | | Fix case where \\ needs to be written as \\\\ in order to appear as a double backslash. Also add mention of release candidates and snapshots. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* nasm.c: consistently use the 'murrican spelling "optimize"H. Peter Anvin2009-07-311-1/+1
| | | | | | | | "Optimise" (and other -ise words) is en_GB, "optimize" (and other "-ize" words) is en_US. Stick to en_US since that is what we seens to be using more already. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* nasm.1 -- update contentsCyrill Gorcunov2009-07-311-1/+50
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* nasm.c -- update info on -O cmdline optionCyrill Gorcunov2009-07-311-1/+4
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Merge commit 'cyr/hpa-list'H. Peter Anvin2009-07-303-12/+8
|\
| * outaout.c -- use list helpersCyrill Gorcunov2009-07-281-6/+4
| | | | | | | | | | | | | | | | | | Note that we use list_for_each(var,var) sometime which actually brings in at least one redundant assignment in case of NULL being passed but save us a few lines of code. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| * assemble.c -- use list helpersCyrill Gorcunov2009-07-271-2/+2
| | | | | | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| * nasm.c -- use list helpersCyrill Gorcunov2009-07-271-4/+2
| | | | | | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | nasm.c -- update help messageCyrill Gorcunov2009-07-311-3/+11
| | | | | | | | | | | | | | Show all options we support at moment via "nasm -h" invoked. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | insns.dat: operand-size syntax for XOP instructionsCyrill Gorcunov2009-07-271-18/+18
| | | | | | | | | | | | Explicitly declare the sizes of immediate fields. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | assemble.c: quiet warningH. Peter Anvin2009-07-271-0/+3
|/ | | | | | | Clear an uninitialized variable warning. The case can't actually happen, but the compiler doesn't know that. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* insns.dat -- operand-size syntax for XOP instructionsCyrill Gorcunov2009-07-271-150/+150
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* assemble.c: clean up matches()H. Peter Anvin2009-07-261-79/+44
| | | | | | Simplify matches(), and quite possibly make it more correct. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge branch 'nasm-2.07.xx'H. Peter Anvin2009-07-261-3/+4
|\
| * BR 2826669: update licensing information in READMEnasm-2.07.xxH. Peter Anvin2009-07-261-3/+4
| | | | | | | | | | | | The code is now under the 2-clause BSD license. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Merge branch 'nasm-2.07.xx'H. Peter Anvin2009-07-261-6/+6
|\ \ | |/
| * BR 2827397: fix invalid C in outcoff AddExports()H. Peter Anvin2009-07-261-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The construct: if (i == nsects) directive_sec = sects[coff_make_section (EXPORT_SECTION_NAME, EXPORT_SECTION_FLAGS)]; ... where coff_make_section() can change the global variable "sects" is undefined C, since there is no sequence point involved in the [] operator, and it is therefore fully permitted for the C compiler to read the sects variable first. Change this construct into two statements to enforce defined behavior; this also ends up with the code slightly simpler. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | insns.pl: smarter handling of operand flagsH. Peter Anvin2009-07-261-12/+31
| | | | | | | | | | | | Handle operand flags like "xmmrm128" correctly. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | assemble: defer "operand size missing" until end of type checkH. Peter Anvin2009-07-251-1/+5
| | | | | | | | | | | | | | | | | | | | | | Defer the "operand size missing" error until we know all the other operands have the correct type. Otherwise we'll end up with false positives, which result in noise entered into the xsizeflags array, thus causing fuzzy matching to fail. It's possible we should defer it even further. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Enable fuzzy matching of operand sizesH. Peter Anvin2009-07-252-14/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows automatic fuzzy matching of operand sizes. If an operand size is not specified, but there is exactly one possible size for the instruction, select that instruction size. This requires a second pass through the instruction patterns, and so is slightly slower, but should be a lot easier to get right than the S- flags, and works even when there is more than one instruction. The new SX (Size eXact) flag can be used to prevent fuzzy matching completely. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | assemble: move the instruction-matching loop into a common functionH. Peter Anvin2009-07-251-184/+203
| | | | | | | | | | | | | | Move the instruction-matching loop into a common function. This gives us a single point to adjust the instruction-selection algorithm. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | assemble: replace random integers with an enum for match resultsH. Peter Anvin2009-07-251-33/+53
| | | | | | | | | | | | | | Match results were reported with random integers. Replace with an enum. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | sync.c - introduce swap_sync helperCyrill Gorcunov2009-07-201-16/+12
| | | | | | | | | | | | Just to remove code duplication Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | preproc.c - remove redundant assignmentCyrill Gorcunov2009-07-201-1/+0
| | | | | | | | | | | | | | There is no need for tline assignment right before it'll be assigned again in for() cycle. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | nasmlib.h - introduce list iterator helpersCyrill Gorcunov2009-07-201-0/+12
| | | | | | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* | Merge branch 'new-preproc'H. Peter Anvin2009-07-1942-2017/+2449
|\ \ | |/ |/|