platform/upstream/nasm.git
13 years agoMerge branch 'nasm-2.09.xx'
Cyrill Gorcunov [Wed, 6 Apr 2011 15:12:17 +0000 (19:12 +0400)]
Merge branch 'nasm-2.09.xx'

Conflicts:
nasm.h
version

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoNASM 2.09.08
Cyrill Gorcunov [Wed, 6 Apr 2011 15:10:24 +0000 (19:10 +0400)]
NASM 2.09.08

13 years agodoc: Updates for stable branch fix
Cyrill Gorcunov [Wed, 6 Apr 2011 15:08:34 +0000 (19:08 +0400)]
doc: Updates for stable branch fix

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoofmt: Alias shortname must be used for __OUTPUT_FORMAT__ macro
Cyrill Gorcunov [Wed, 6 Apr 2011 14:32:15 +0000 (18:32 +0400)]
ofmt: Alias shortname must be used for __OUTPUT_FORMAT__ macro

__OUTPUT_FORMAT__ must consist of shortname of output format
or its alias, otherwise userspace ABI gets broken.

For example source code still can refer to __OUTPUT_FORMAT__=elf,
instead of __OUTPUT_FORMAT__=elf32.

BR3246990

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branch 'nasm-2.09.xx'
H. Peter Anvin [Tue, 15 Mar 2011 22:41:54 +0000 (15:41 -0700)]
Merge branch 'nasm-2.09.xx'

13 years agoopenwcom.mak: Update to use features from newer WMAKE
Jiri Malak [Tue, 15 Mar 2011 22:37:30 +0000 (15:37 -0700)]
openwcom.mak: Update to use features from newer WMAKE

Change the OpenWatcom WMAKE Makefile to use the facilities available
in WMAKE to support cross-compilation properly.

See BR 3079573.

13 years agoMerge branch 'nasm-2.09.xx'
Cyrill Gorcunov [Sat, 12 Mar 2011 19:35:42 +0000 (22:35 +0300)]
Merge branch 'nasm-2.09.xx'

Conflicts:
doc/changes.src
version

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoNASM 2.09.07
Cyrill Gorcunov [Sat, 12 Mar 2011 19:31:15 +0000 (22:31 +0300)]
NASM 2.09.07

 - Fix crash for -a option
 - Fix VEXTRACTF128, VMASKMOVPS instructions

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agodoc: Update changes
Cyrill Gorcunov [Mon, 7 Mar 2011 09:44:43 +0000 (12:44 +0300)]
doc: Update changes

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agotest: Add br3189064
Cyrill Gorcunov [Mon, 7 Mar 2011 09:42:46 +0000 (12:42 +0300)]
test: Add br3189064

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3189064: Fixes for VEXTRACTF128, VMASKMOVPS
Cyrill Gorcunov [Mon, 7 Mar 2011 09:40:22 +0000 (12:40 +0300)]
BR3189064: Fixes for VEXTRACTF128, VMASKMOVPS

These AVX instructions should use YMM register

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agodoc: Update changes
Cyrill Gorcunov [Mon, 7 Mar 2011 08:35:18 +0000 (11:35 +0300)]
doc: Update changes

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agotest: Add br3200749
Cyrill Gorcunov [Mon, 7 Mar 2011 08:29:56 +0000 (11:29 +0300)]
test: Add br3200749

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc.c: Don't forget to dup filename before free
Cyrill Gorcunov [Mon, 7 Mar 2011 08:23:08 +0000 (11:23 +0300)]
preproc.c: Don't forget to dup filename before free

src_set_fname simply gets copy of pointer (ideally
we need refcounting here) so don't pass the name
which will be freed soon but rather pass a copy.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3200749: Fix "use after close" file pointer
Cyrill Gorcunov [Mon, 7 Mar 2011 08:18:50 +0000 (11:18 +0300)]
BR3200749: Fix "use after close" file pointer

Cleanup routine might be called several times
so be ready for that.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc.c: Fix use-after-free bug
Cyrill Gorcunov [Thu, 3 Mar 2011 06:18:56 +0000 (09:18 +0300)]
preproc.c: Fix use-after-free bug

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoNASM 2.10rc4
Cyrill Gorcunov [Mon, 28 Feb 2011 07:05:15 +0000 (10:05 +0300)]
NASM 2.10rc4

13 years agoMerge branch 'nasm-2.09.xx'
Cyrill Gorcunov [Mon, 28 Feb 2011 07:03:53 +0000 (10:03 +0300)]
Merge branch 'nasm-2.09.xx'

Conflicts:
doc/changes.src
output/outbin.c
version

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoNASM 2.09.06
Cyrill Gorcunov [Mon, 28 Feb 2011 07:00:31 +0000 (10:00 +0300)]
NASM 2.09.06

13 years agodoc: Describe changes for 2.09.06
Cyrill Gorcunov [Mon, 28 Feb 2011 06:58:52 +0000 (09:58 +0300)]
doc: Describe changes for 2.09.06

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agooutput/outbin.c: initialize section align/start attributes upon creation
Keith Kanios [Sun, 27 Feb 2011 19:14:32 +0000 (13:14 -0600)]
output/outbin.c: initialize section align/start attributes upon creation

13 years agoelf64: Use nasm_zalloc helper
Cyrill Gorcunov [Mon, 28 Feb 2011 06:45:43 +0000 (09:45 +0300)]
elf64: Use nasm_zalloc helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agooutelf32: Use nasm_zalloc helper
Cyrill Gorcunov [Mon, 28 Feb 2011 06:40:43 +0000 (09:40 +0300)]
outelf32: Use nasm_zalloc helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agooutcoff: Use nasm_zalloc helper
Cyrill Gorcunov [Mon, 28 Feb 2011 06:33:08 +0000 (09:33 +0300)]
outcoff: Use nasm_zalloc helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agobin: Use nasm_zalloc for default section creation
Cyrill Gorcunov [Mon, 28 Feb 2011 06:28:25 +0000 (09:28 +0300)]
bin: Use nasm_zalloc for default section creation

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc: Use nasm_zalloc helper
Cyrill Gorcunov [Mon, 28 Feb 2011 05:45:52 +0000 (08:45 +0300)]
preproc: Use nasm_zalloc helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agobin: Use nasm_zalloc helper for section allocation in a sake of simplicity
Cyrill Gorcunov [Sun, 27 Feb 2011 22:18:54 +0000 (01:18 +0300)]
bin: Use nasm_zalloc helper for section allocation in a sake of simplicity

Instead of opencoded zero assignments better to use nasm_zalloc
and set fields which are supposed to be non-nil. This simplifies
code and makes it more readable.

Also note the field 'ifollows' renamed to 'prev' as it should
be from the very beginning in terms of lists.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agooutput/outbin.c: initialize section align/start attributes upon creation
Keith Kanios [Sun, 27 Feb 2011 19:14:32 +0000 (13:14 -0600)]
output/outbin.c: initialize section align/start attributes upon creation

13 years agoMerge branch 'nasm-2.09.xx'
Cyrill Gorcunov [Tue, 22 Feb 2011 21:49:41 +0000 (00:49 +0300)]
Merge branch 'nasm-2.09.xx'

13 years agodoc: Describe changes
Cyrill Gorcunov [Tue, 22 Feb 2011 21:49:13 +0000 (00:49 +0300)]
doc: Describe changes

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoinsns: VLDQQU is back
Cyrill Gorcunov [Tue, 22 Feb 2011 21:41:43 +0000 (00:41 +0300)]
insns: VLDQQU is back

As HPA explained
|
| w.r.t. the -QQ- instruction forms... when we did
| the initial AVX implementation we decided that
| using -DQ- (double quadword) for 256-bit instructions
| was a bit messy, so we decided to accept both -DQ-
| (being official) and -QQ-
|

So move VLDQQU back and place it before VLDDQU so disassembler
match it first.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branch 'nasm-2.09.xx'
Cyrill Gorcunov [Mon, 21 Feb 2011 15:19:26 +0000 (18:19 +0300)]
Merge branch 'nasm-2.09.xx'

13 years agotest: Add test for BR 3187743
Cyrill Gorcunov [Mon, 21 Feb 2011 15:19:04 +0000 (18:19 +0300)]
test: Add test for BR 3187743

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR 3187743: insns.dat -- Rename VLDQQU to VLDDQU
Cyrill Gorcunov [Mon, 21 Feb 2011 15:15:43 +0000 (18:15 +0300)]
BR 3187743: insns.dat -- Rename VLDQQU to VLDDQU

Fix a misprint

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoDrop LLC compiler support
Cyrill Gorcunov [Sun, 20 Feb 2011 21:05:48 +0000 (00:05 +0300)]
Drop LLC compiler support

Seems it's been not used for years anyway

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branch 'nasm-2.09.xx'
Cyrill Gorcunov [Sun, 20 Feb 2011 20:56:43 +0000 (23:56 +0300)]
Merge branch 'nasm-2.09.xx'

Conflicts:
version

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoNASM 2.09.05
Cyrill Gorcunov [Sun, 20 Feb 2011 19:16:30 +0000 (22:16 +0300)]
NASM 2.09.05

Fixes for vpextrw instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agodoc: Update changes.src
Cyrill Gorcunov [Sun, 20 Feb 2011 19:12:32 +0000 (22:12 +0300)]
doc: Update changes.src

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoDelete invalid form of VPEXTRW
Cyrill Gorcunov [Sun, 20 Feb 2011 19:10:40 +0000 (22:10 +0300)]
Delete invalid form of VPEXTRW

Mainline commit 47c95ceed447fff457f898bcea4facfbf9a2f710

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agodoc: Describe changes for 2.09.05 stable
Cyrill Gorcunov [Sun, 20 Feb 2011 18:22:25 +0000 (21:22 +0300)]
doc: Describe changes for 2.09.05 stable

Onle one change here but wrong instruction encoding is
pretty serious error which desrves to go into new stable
release.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoinsns.dat: Remove vpextrw merge rudiment
Cyrill Gorcunov [Mon, 14 Feb 2011 19:28:49 +0000 (22:28 +0300)]
insns.dat: Remove vpextrw merge rudiment

During merging I've brought in vpextrw with mem16
back again, fixed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branch 'nasm-2.09.xx'
Cyrill Gorcunov [Mon, 14 Feb 2011 19:21:50 +0000 (22:21 +0300)]
Merge branch 'nasm-2.09.xx'

Conflicts:
insns.dat

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agotest: Add test for BR3174983
Cyrill Gorcunov [Mon, 14 Feb 2011 19:14:51 +0000 (22:14 +0300)]
test: Add test for BR3174983

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3174983: insns.dat -- Fix arguments encodong for VPEXTRW
Cyrill Gorcunov [Mon, 14 Feb 2011 19:04:51 +0000 (22:04 +0300)]
BR3174983: insns.dat -- Fix arguments encodong for VPEXTRW

This form of VPEXTRW is that named 'B' form so
operands encoding should be fixed.

Reported-by: Jasper Neumann
Patch-by: Jasper Neumann
CC: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agomake: Add cscope targed
Cyrill Gorcunov [Sat, 25 Dec 2010 20:32:09 +0000 (23:32 +0300)]
make: Add cscope targed

For easier use of cscope

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMove implicit operand size override logic to calc_size
Victor van den Elzen [Wed, 29 Dec 2010 17:13:38 +0000 (17:13 +0000)]
Move implicit operand size override logic to calc_size

It is more logical, it cleans up the code and it makes implicit
operand size override prefixes come out in the same order as explicit
ones instead of after all other prefixes.

Suggested-by: H. Peter Anvin <hpa@zytor.com>
13 years agoBR 3143040: Remove invalid form of VPEXTRW
H. Peter Anvin [Fri, 24 Dec 2010 00:37:14 +0000 (16:37 -0800)]
BR 3143040: Remove invalid form of VPEXTRW

The 0F form, unlike the 0F3A form, of VPEXTRW cannot write a 16-bit
memory location by specification.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agopreproc.c: fix tokenize() warnings for ignored expansion definitions
Keith Kanios [Sat, 18 Dec 2010 20:08:02 +0000 (14:08 -0600)]
preproc.c: fix tokenize() warnings for ignored expansion definitions

13 years agodoc/nasmdoc.src: document additions from preprocessor-rewrite merge
Keith Kanios [Sat, 18 Dec 2010 19:19:01 +0000 (13:19 -0600)]
doc/nasmdoc.src: document additions from preprocessor-rewrite merge

13 years agopreproc.c: simplify %un[i]macro warning message
Keith Kanios [Sat, 18 Dec 2010 18:22:21 +0000 (12:22 -0600)]
preproc.c: simplify %un[i]macro warning message

13 years agopreproc.c: warn/ignore when attempting to %un[i]macro an active macro
Keith Kanios [Sat, 18 Dec 2010 18:17:31 +0000 (12:17 -0600)]
preproc.c: warn/ignore when attempting to %un[i]macro an active macro

13 years agopreproc.c: replace tabs with spaces on recent commits
Keith Kanios [Sat, 18 Dec 2010 17:49:53 +0000 (11:49 -0600)]
preproc.c: replace tabs with spaces on recent commits

13 years agopreproc.c: free expansion definitions as needed
Keith Kanios [Sat, 18 Dec 2010 17:47:28 +0000 (11:47 -0600)]
preproc.c: free expansion definitions as needed

13 years agopreproc.c: free tokens when ignoring expansion definition lines
Keith Kanios [Sat, 18 Dec 2010 17:05:46 +0000 (11:05 -0600)]
preproc.c: free tokens when ignoring expansion definition lines

13 years agopreproc.c: placate tokenize() warnings during expansion definition
Keith Kanios [Sat, 18 Dec 2010 16:54:39 +0000 (10:54 -0600)]
preproc.c: placate tokenize() warnings during expansion definition

13 years agoNASM 2.10rc3
H. Peter Anvin [Sat, 18 Dec 2010 01:55:22 +0000 (17:55 -0800)]
NASM 2.10rc3

13 years agoinsns.pl: Fix up merge conflict for sure
Cyrill Gorcunov [Tue, 23 Nov 2010 17:21:45 +0000 (20:21 +0300)]
insns.pl: Fix up merge conflict for sure

Now it should be fixed in real (one code snipped
escaped me during merge conflict resolving).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branch 'insns'
Cyrill Gorcunov [Tue, 23 Nov 2010 16:26:24 +0000 (19:26 +0300)]
Merge branch 'insns'

Conflicts:
insns.pl

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoinsns: Fixup MOV[APS|UPS] for xmmrm cases
Cyrill Gorcunov [Tue, 23 Nov 2010 12:57:19 +0000 (15:57 +0300)]
insns: Fixup MOV[APS|UPS] for xmmrm cases

In fact it was written as

MOVAPS xmmreg,xmmreg \360\2\x0F\x28\110 KATMAI,SSE
MOVAPS xmmreg,xmmreg \360\2\x0F\x29\101 KATMAI,SSE

in first place

MOVUPS xmmreg,xmmreg \360\2\x0F\x10\110 KATMAI,SSE
MOVUPS xmmreg,xmmreg \360\2\x0F\x11\101 KATMAI,SSE

and for example x28 stands for xmmrm128,xmmreg and
x1 for xmmrm128,xmmreg.

TODO: Inspect and fix WILLAMETTE instructions.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoinsns: Implement size bits on KATMAI
Cyrill Gorcunov [Sat, 20 Nov 2010 18:43:34 +0000 (21:43 +0300)]
insns: Implement size bits on KATMAI

Perhaps not all of them are coevered yet, but mostly.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoinsns.pl: Clear tabs/space mess
Cyrill Gorcunov [Sat, 20 Nov 2010 22:04:46 +0000 (01:04 +0300)]
insns.pl: Clear tabs/space mess

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agomake: Lift up openwcom.mak for build on FreeDOS
Anthony Williams [Sat, 30 Oct 2010 16:07:50 +0000 (20:07 +0400)]
make: Lift up openwcom.mak for build on FreeDOS

Signed-off-by: Anthony Williams <rugxulo@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branch 'nasm-2.09.xx'
Cyrill Gorcunov [Sun, 21 Nov 2010 16:56:21 +0000 (19:56 +0300)]
Merge branch 'nasm-2.09.xx'

Conflicts:
version

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoNASM 2.09.04
Cyrill Gorcunov [Sun, 21 Nov 2010 16:53:07 +0000 (19:53 +0300)]
NASM 2.09.04

Some important fixes:

 - Fix incorrect labels offset for VEX intructions
 - Eliminate bogus warning on implicit operand size override.
 - %if term could not handle 64 bit numbers.
 - The COFF backend was limiting relocations number to 16 bits even if
   in real there were a way more relocations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoChanges for 2.09.04
Cyrill Gorcunov [Sun, 21 Nov 2010 16:51:49 +0000 (19:51 +0300)]
Changes for 2.09.04

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3104852: only warn once for repeated prefixes
Victor van den Elzen [Sun, 7 Nov 2010 22:47:13 +0000 (23:47 +0100)]
BR3104852: only warn once for repeated prefixes

13 years agoBR3058845: mostly fix bogus warning with implicit operand size override
Victor van den Elzen [Sun, 7 Nov 2010 18:56:14 +0000 (19:56 +0100)]
BR3058845: mostly fix bogus warning with implicit operand size override

The implicit operand size override code didn't set the operand size
prefix, which confused the size calculation code for the range check.

The BITS 64 operand size calculation is still off, but "fixing" it by
making it 32-bit unless REX.W is set breaks PUSH and maybe others.

13 years agomisc: Enhance tag-release
Cyrill Gorcunov [Sun, 21 Nov 2010 16:19:29 +0000 (19:19 +0300)]
misc: Enhance tag-release

It remains backward compatible

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoeval: rexp3 should operate with 64bit numbers
Cyrill Gorcunov [Sat, 6 Nov 2010 20:04:12 +0000 (23:04 +0300)]
eval: rexp3 should operate with 64bit numbers

reloc_value returns 64bit numbers but we strip it down
to 'int' which causes problems if the former value is
big enough to overflow 'int'. Fix it.

[ BR3104312 ]

Reported-by: Christian Masloch
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoFix autoconf 2.68 warning.
Victor van den Elzen [Sun, 7 Nov 2010 16:31:27 +0000 (17:31 +0100)]
Fix autoconf 2.68 warning.

The first argument of AC_COMPILE_IFELSE needs to be wrapped with
AC_LANG_SOURCE.

13 years agocoff: Handle massive relocations
Cyrill Gorcunov [Sat, 20 Nov 2010 11:18:23 +0000 (14:18 +0300)]
coff: Handle massive relocations

The backport of

4db724fdd76e3a6cd0f5124ef86de976c495d666
359b63f8976375f071edc33092daea57efa768fb
01102ee8e6a967830bcd6f0134efe8976f473121
2672af737954fb17ec0ebf17e787219a504c4400

so coff output target to be able to handle
massive relocations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branch 'nasm-2.09.xx'
H. Peter Anvin [Tue, 16 Nov 2010 17:40:03 +0000 (09:40 -0800)]
Merge branch 'nasm-2.09.xx'

13 years agoBR 3109604: Fix C4 vs C5 VEX form selection in calcsize()
H. Peter Anvin [Tue, 16 Nov 2010 17:36:58 +0000 (09:36 -0800)]
BR 3109604: Fix C4 vs C5 VEX form selection in calcsize()

calcsize() had the wrong criterion for when C5 prefixes are permitted
(REX.R is permitted, REX.X is forbidden.)  assemble() had the right
test already.  This caused symbol value errors.

13 years agopreproc.c: fix handling of %? and %??
Keith Kanios [Sat, 13 Nov 2010 15:34:34 +0000 (09:34 -0600)]
preproc.c: fix handling of %? and %??

13 years agoMerge branch 'cleanup'
Cyrill Gorcunov [Thu, 11 Nov 2010 20:09:22 +0000 (23:09 +0300)]
Merge branch 'cleanup'

13 years agoRevert 29cb0bb1b39f4e3c9e013993457e85fce14f5142
Cyrill Gorcunov [Thu, 11 Nov 2010 20:08:14 +0000 (23:08 +0300)]
Revert 29cb0bb1b39f4e3c9e013993457e85fce14f5142

Redundant call on nonsmart compilers doesn't
worth it in compare with two assignment operations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc: Add dump_token helper
Cyrill Gorcunov [Thu, 11 Nov 2010 12:06:12 +0000 (15:06 +0300)]
preproc: Add dump_token helper

While being debugging some nifty problem I found
that it might be useful to produce a full dump of
tokens, in particular text of tokens.

For this reason dump_token is here just to not loose
it. It doesn't affect normal build procedure since it
requires a special -DNASM_TRACE to be passed to the
compiler. Which of course we don't in a regular
compilations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc: Use nasm_zalloc more
Cyrill Gorcunov [Thu, 11 Nov 2010 10:44:51 +0000 (13:44 +0300)]
preproc: Use nasm_zalloc more

To eliminate possible access into heap data

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc: Use memset for stack allocated structure
Cyrill Gorcunov [Thu, 11 Nov 2010 08:42:40 +0000 (11:42 +0300)]
preproc: Use memset for stack allocated structure

To be on safe side

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc: inc_fopen -- set sl->next early
Cyrill Gorcunov [Thu, 11 Nov 2010 08:32:16 +0000 (11:32 +0300)]
preproc: inc_fopen -- set sl->next early

It's safer to init it early and be sure we not
miss anything after.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc: Use nasm_zalloc for new_ExpDef, new_ExpInv
Cyrill Gorcunov [Thu, 11 Nov 2010 08:29:40 +0000 (11:29 +0300)]
preproc: Use nasm_zalloc for new_ExpDef, new_ExpInv

Srink the code and make it a bit faster.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc: Use nasm_zalloc in new_Line
Cyrill Gorcunov [Thu, 11 Nov 2010 08:19:43 +0000 (11:19 +0300)]
preproc: Use nasm_zalloc in new_Line

It's shorter

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoautoconf: Add --with-ccache option
Cyrill Gorcunov [Thu, 11 Nov 2010 08:18:44 +0000 (11:18 +0300)]
autoconf: Add --with-ccache option

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc.c: Get rid of tab/space mess
Cyrill Gorcunov [Thu, 11 Nov 2010 07:14:45 +0000 (10:14 +0300)]
preproc.c: Get rid of tab/space mess

No change on binary level

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc: do_directive: Allocate 'Include' from zeroified-memory
Cyrill Gorcunov [Wed, 10 Nov 2010 20:12:06 +0000 (23:12 +0300)]
preproc: do_directive: Allocate 'Include' from zeroified-memory

If not all members of structure being allocated from
heap get initialized we better to use nasm_zalloc instead
of nasm_malloc.

For example inc gets allocated in do_directive being parially
initialized and we erroniously get mmac_depth set to some
crappy value leading to SIGSEV in result.

[ http://forum.nasm.us/index.php?topic=921.msg3257#msg3257 ]

nb: I've cleaned verror from tab/space mess while were at it

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc.c: use nasm_strdup() rather than naked strdup()
H. Peter Anvin [Mon, 8 Nov 2010 16:36:36 +0000 (08:36 -0800)]
preproc.c: use nasm_strdup() rather than naked strdup()

13 years agopreproc.c: placate errors in OpenWatcom Compiler
Keith Kanios [Mon, 8 Nov 2010 06:58:02 +0000 (00:58 -0600)]
preproc.c: placate errors in OpenWatcom Compiler

13 years agoBR3104852: only warn once for repeated prefixes
Victor van den Elzen [Sun, 7 Nov 2010 22:47:13 +0000 (23:47 +0100)]
BR3104852: only warn once for repeated prefixes

13 years agoBR3058845: mostly fix bogus warning with implicit operand size override
Victor van den Elzen [Sun, 7 Nov 2010 18:56:14 +0000 (19:56 +0100)]
BR3058845: mostly fix bogus warning with implicit operand size override

The implicit operand size override code didn't set the operand size
prefix, which confused the size calculation code for the range check.

The BITS 64 operand size calculation is still off, but "fixing" it by
making it 32-bit unless REX.W is set breaks PUSH and maybe others.

13 years agopreproc.c: Fix OpenWatcom compiler error
Keith Kanios [Sun, 7 Nov 2010 22:21:00 +0000 (16:21 -0600)]
preproc.c: Fix OpenWatcom compiler error

13 years agopreproc.c: Fix OpenWatcom compiler error
Cyrill Gorcunov [Sun, 7 Nov 2010 21:47:10 +0000 (00:47 +0300)]
preproc.c: Fix OpenWatcom compiler error

It doesn't like when we mess scope of variables
declaration.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoFix autoconf 2.68 warning.
Victor van den Elzen [Sun, 7 Nov 2010 16:31:27 +0000 (17:31 +0100)]
Fix autoconf 2.68 warning.

The first argument of AC_COMPILE_IFELSE needs to be wrapped with
AC_LANG_SOURCE.

13 years agoFix Perl deprecation warnings.
Victor van den Elzen [Sun, 7 Nov 2010 16:20:23 +0000 (17:20 +0100)]
Fix Perl deprecation warnings.

Use of defined on aggregates (hashes and arrays) is deprecated.
You should instead use a simple test for size.

13 years agoNASM 2.10rc2
Keith Kanios [Sat, 6 Nov 2010 23:09:15 +0000 (18:09 -0500)]
NASM 2.10rc2

13 years agoversion: reverting back to 2.10rc1
Keith Kanios [Sat, 6 Nov 2010 23:08:32 +0000 (18:08 -0500)]
version: reverting back to 2.10rc1

13 years agopreproc.c: merge from preproc-rewrite branch
Keith Kanios [Sat, 6 Nov 2010 22:41:51 +0000 (17:41 -0500)]
preproc.c: merge from preproc-rewrite branch
pptok.dat: merge from preproc-rewrite branch
macros.pl: merge from preproc-rewrite branch
version: changed to 2.10rc2

13 years agocoff: Cover 'else' with cond compilation
Cyrill Gorcunov [Sat, 6 Nov 2010 22:09:36 +0000 (01:09 +0300)]
coff: Cover 'else' with cond compilation

It was a nit in first place.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agotest: Add br3104312.asm test
Cyrill Gorcunov [Sat, 6 Nov 2010 20:09:47 +0000 (23:09 +0300)]
test: Add br3104312.asm test

Not automated yet

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoeval: rexp3 should operate with 64bit numbers
Cyrill Gorcunov [Sat, 6 Nov 2010 20:04:12 +0000 (23:04 +0300)]
eval: rexp3 should operate with 64bit numbers

reloc_value returns 64bit numbers but we strip it down
to 'int' which causes problems if the former value is
big enough to overflow 'int'. Fix it.

[ BR3104312 ]

Reported-by: Christian Masloch
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branch 'owc'
Cyrill Gorcunov [Sat, 6 Nov 2010 15:50:10 +0000 (18:50 +0300)]
Merge branch 'owc'