Commit Graph

1928 Commits

Author SHA1 Message Date
H. Peter Anvin
5f3bd5dbf0 misc/release: *.ico are binary files
Zip needs to know which files to treat as binary, so tell it *.ico are
binary files.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-09-23 09:54:10 -07:00
Cyrill Gorcunov
6bd3f0bd9c nasm.nsi: restore old output name and compressor
Othrewise build robot fails

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-09-23 20:43:34 +04:00
Cyrill Gorcunov
33dd6d94c3 nasm.nsi: do not define VERSION twice
VERSION is already defined in version.nsh
no need to define it araing otherwise nsis
compiler fails.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-09-23 17:45:01 +04:00
Cyrill Gorcunov
c29cdb961e substitute nasm.nsi with new nasm2.nsi
We always have "restore point" but such an action will
allow us to test new installer in more wide audience.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-09-21 23:15:55 +04:00
Cyrill Gorcunov
f551e82fdf nsis2: prepare for substitution
- We need to change slashes to direct ones
- Installer file should be postfixed with plain "-installer"
- Remove nasm.exe duplication

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-09-21 23:13:48 +04:00
Cyrill Gorcunov
2726889ece New NSIS script
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>
2009-09-14 23:17:03 +04:00
Cyrill Gorcunov
69c4f63c25 elf,stabs: stabs32/64_generate -- append ending token
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>
2009-09-14 22:43:30 +04:00
Cyrill Gorcunov
28032a027c output/elfcommon.h: tab/space cleanup
No change on binary level

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-09-06 15:25:35 +04:00
Cyrill Gorcunov
7ea1ef1c84 output/outelf32.c: code style simplification
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>
2009-09-03 20:16:28 +04:00
Cyrill Gorcunov
6ae5903676 output/outelf32.c: tab-space cleanup
Together with a small style nitpicking.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-09-03 20:02:33 +04:00
Cyrill Gorcunov
82a440da6d output/elf64.h: tab-space cleanup
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-09-03 19:10:55 +04:00
Cyrill Gorcunov
c5e7878943 output/elf32.h: tab-space cleanup
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-09-03 19:06:04 +04:00
Cyrill Gorcunov
2cff224e4b output/outelf.h - tab-space cleanup
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-09-03 19:04:23 +04:00
Cyrill Gorcunov
3757524161 Use I_none opcode instead of hardcoded number
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>
2009-08-23 10:40:17 -07:00
Victor van den Elzen
0dd450c0ef Use fputs instead of fprintf for plain strings
LLVM's Clang warns about this. outieee.c had a real problem.
2009-08-13 15:07:59 +02:00
Victor van den Elzen
15bb233036 Fix some format strings for nasm_error
Added a format attribute to nasm_error (only for GCC) and
used the resulting warnings to fix some format strings.
2009-08-11 02:43:41 +02:00
Cyrill Gorcunov
5a49e7c578 output/dwarf.h: update dwarf constants
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>
2009-08-10 16:00:43 -07:00
H. Peter Anvin
eaa68f1c85 Add strlcpy() function
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>
2009-08-10 15:59:34 -07:00
H. Peter Anvin
767750b666 output: change null_debug_routine to null_debug_directive
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>
2009-08-09 13:04:13 -07:00
Cyrill Gorcunov
0a45cc8ce8 disasm.c: eatbyte -- use snprintf to prevent potential buffer overflow
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>
2009-08-09 10:30:48 -07:00
Cyrill Gorcunov
c9b2d2a8ec headers/c: strip off useless spaces
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>
2009-08-09 10:28:27 -07:00
Cyrill Gorcunov
23c6f213bd insns.pl: remove redundant empty line in enum opcode
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-08-08 14:00:47 -07:00
H. Peter Anvin
8bec2c788f nasm.c: fix stack overrun in assemble_file
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>
2009-08-08 13:49:00 -07:00
H. Peter Anvin
f903da144d Merge commit 'cyr/hpa-dat' 2009-08-07 09:16:47 -07:00
H. Peter Anvin
3815aa7783 Merge commit 'cyr/hpa-list' 2009-08-07 09:16:19 -07:00
Cyrill Gorcunov
509aa63b31 insns.dat -- convert FMA instructions
Convert FMA instructions to explicit sized ones.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-08-07 18:42:40 +04:00
Cyrill Gorcunov
e652f82798 insns.dat -- convert AVX instructions part2
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>
2009-08-07 18:41:52 +04:00
Cyrill Gorcunov
b2cad279d9 insns.dat -- convert AVX instructions part1
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>
2009-08-07 00:26:54 +04:00
H. Peter Anvin
a5547dcb74 doc: \ needs to be repeated except in \c-line context; daily snapshots
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>
2009-08-02 14:16:07 -07:00
Cyrill Gorcunov
6f742649fe output/outbin.c -- use list helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-08-01 23:52:25 +04:00
H. Peter Anvin
f46c0d6733 nasm.c: consistently use the 'murrican spelling "optimize"
"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>
2009-07-31 08:03:32 -07:00
Cyrill Gorcunov
124a462cc2 nasm.1 -- update contents
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-07-31 14:30:33 +04:00
Cyrill Gorcunov
73b87c68b1 nasm.c -- update info on -O cmdline option
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-07-31 10:26:55 +04:00
H. Peter Anvin
e873c9b16b Merge commit 'cyr/hpa-list' 2009-07-30 15:06:47 -07:00
Cyrill Gorcunov
984c4db12f nasm.c -- update help message
Show all options we support at moment
via "nasm -h" invoked.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-07-31 00:32:17 +04:00
Cyrill Gorcunov
a95a76a868 outaout.c -- use list helpers
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>
2009-07-28 23:26:12 +04:00
Cyrill Gorcunov
e6ccff9997 insns.dat: operand-size syntax for XOP instructions
Explicitly declare the sizes of immediate fields.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-27 15:49:11 -07:00
Cyrill Gorcunov
a92a3a5c49 assemble.c -- use list helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-07-27 22:33:59 +04:00
H. Peter Anvin
ed3e84f9cd assemble.c: quiet warning
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>
2009-07-27 11:10:33 -07:00
Cyrill Gorcunov
fcd0a74330 nasm.c -- use list helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-07-27 16:26:26 +04:00
Cyrill Gorcunov
77df046f0b insns.dat -- operand-size syntax for XOP instructions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-07-27 12:32:30 +04:00
H. Peter Anvin
60926244f1 assemble.c: clean up matches()
Simplify matches(), and quite possibly make it more correct.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-26 16:25:38 -07:00
H. Peter Anvin
5c143a2162 Merge branch 'nasm-2.07.xx' 2009-07-26 15:42:09 -07:00
H. Peter Anvin
47c9479dc3 BR 2826669: update licensing information in README
The code is now under the 2-clause BSD license.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-26 15:40:38 -07:00
H. Peter Anvin
e39dc8c5b2 Merge branch 'nasm-2.07.xx' 2009-07-26 15:31:59 -07:00
H. Peter Anvin
7ad24562dc BR 2827397: fix invalid C in outcoff AddExports()
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>
2009-07-26 15:29:09 -07:00
H. Peter Anvin
109b030f01 insns.pl: smarter handling of operand flags
Handle operand flags like "xmmrm128" correctly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-26 12:52:22 -07:00
H. Peter Anvin
3fb86f2cd6 assemble: defer "operand size missing" until end of type check
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>
2009-07-25 19:12:10 -07:00
H. Peter Anvin
a81655bffb Enable fuzzy matching of operand sizes
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>
2009-07-25 18:15:28 -07:00
H. Peter Anvin
23595f5946 assemble: move the instruction-matching loop into a common function
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>
2009-07-25 17:44:25 -07:00