platform/upstream/nasm.git
14 years agonasmdoc: add missing comma
H. Peter Anvin [Fri, 7 May 2010 20:14:45 +0000 (13:14 -0700)]
nasmdoc: add missing comma

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agonasmdoc: update the full set of numeric prefix/suffix characters.
H. Peter Anvin [Fri, 7 May 2010 20:12:12 +0000 (13:12 -0700)]
nasmdoc: update the full set of numeric prefix/suffix characters.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agooutobj: update error message
H. Peter Anvin [Fri, 7 May 2010 00:58:46 +0000 (17:58 -0700)]
outobj: update error message

The possible sizes we can encounter are 1, 2, 4, 8... make sure we get
a proper error message.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agooutobj: properly error on unsupported relocations
H. Peter Anvin [Fri, 7 May 2010 00:52:57 +0000 (17:52 -0700)]
outobj: properly error on unsupported relocations

Error out on any relocations not supported by the backend.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agooutelf64: update copyright date
H. Peter Anvin [Fri, 7 May 2010 00:45:39 +0000 (17:45 -0700)]
outelf64: update copyright date

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoELF support for 8-bit relocations
H. Peter Anvin [Thu, 6 May 2010 23:14:00 +0000 (16:14 -0700)]
ELF support for 8-bit relocations

Support 8-bit relocations (OUT_ADDRESS and OUT_REL1ADR) in ELF.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoPermit short intersegment jumps
H. Peter Anvin [Thu, 6 May 2010 22:32:20 +0000 (15:32 -0700)]
Permit short intersegment jumps

Allow an intersegment jump to be short (OUT_REL1ADR) if explicitly
specified so by the user.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoAdd support for one-byte relocations
H. Peter Anvin [Thu, 6 May 2010 22:25:43 +0000 (15:25 -0700)]
Add support for one-byte relocations

Add OUT_REL1ADR (one-byte relative address) and support for
OUT_ADDRESs with size == 1.  Add support for it in
outbin and outdbg.  *It still needs to be added to other backends*,
both the OUT_REL*ADR and OUT_ADDRESS codepaths need to be handled.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoMachO: Fix misprinted macho_sectalign
Cyrill Gorcunov [Wed, 28 Apr 2010 19:17:13 +0000 (23:17 +0400)]
MachO: Fix misprinted macho_sectalign

macho_sectalign was occasionally misprinted
with macho_setcalign, fix it. No change on functionality.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoobj: Implement sectalign helper
Cyrill Gorcunov [Sun, 25 Apr 2010 18:00:15 +0000 (22:00 +0400)]
obj: Implement sectalign helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agomacho: Implement sectalign handler
Cyrill Gorcunov [Sun, 25 Apr 2010 17:35:09 +0000 (21:35 +0400)]
macho: Implement sectalign handler

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoieee: Fix section index match in sectalign handler
Cyrill Gorcunov [Sun, 25 Apr 2010 13:55:52 +0000 (17:55 +0400)]
ieee: Fix section index match in sectalign handler

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoheaders: Update year
Cyrill Gorcunov [Sun, 25 Apr 2010 08:02:38 +0000 (12:02 +0400)]
headers: Update year

It's 2010 now

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agooutieee: Implement sectalign handler
Cyrill Gorcunov [Sat, 24 Apr 2010 21:17:11 +0000 (01:17 +0400)]
outieee: Implement sectalign handler

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agooutbin: Drop current_section variable
Cyrill Gorcunov [Thu, 22 Apr 2010 18:32:17 +0000 (22:32 +0400)]
outbin: Drop current_section variable

There is no need for it anymore.

Reported-by: "H. Peter Anvin" <hpa@linux.intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agooutbin: Prune ancient format_mode variable
Cyrill Gorcunov [Thu, 22 Apr 2010 18:24:04 +0000 (22:24 +0400)]
outbin: Prune ancient format_mode variable

format_mode is always set to 1 so there is no need to
keep this variable. "Old chicken bit" (c) :)

Reported-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoilog2: optimize use of bsr for x86-64
H. Peter Anvin [Thu, 22 Apr 2010 18:02:56 +0000 (11:02 -0700)]
ilog2: optimize use of bsr for x86-64

On x86-64 platforms, we can rely on BSR not changing the destination
operand when the input is zero.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agodoc: use bouncer URLs for the ABI docs
H. Peter Anvin [Wed, 7 Apr 2010 05:40:47 +0000 (22:40 -0700)]
doc: use bouncer URLs for the ABI docs

MSDN can't seem to keep their URLs stable, so use bouncer links
that we can change if necessary.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agobin: Implement sectalign handler
Cyrill Gorcunov [Thu, 22 Apr 2010 12:37:56 +0000 (16:37 +0400)]
bin: Implement sectalign handler

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agocoff: Use IMAGE_SCN_ALIGN_MASK macro
Cyrill Gorcunov [Thu, 22 Apr 2010 11:21:37 +0000 (15:21 +0400)]
coff: Use IMAGE_SCN_ALIGN_MASK macro

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agocoff: Allow alignment greater then 64 bytes on win
Cyrill Gorcunov [Thu, 22 Apr 2010 11:17:35 +0000 (15:17 +0400)]
coff: Allow alignment greater then 64 bytes on win

On win32/64 we have no 64 bytes limit so hit it on
"coff" target only.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agocoff: Fix section alignment computation
Cyrill Gorcunov [Thu, 22 Apr 2010 11:05:19 +0000 (15:05 +0400)]
coff: Fix section alignment computation

Section alignment is broken due to not being
direct "align -> power of two set" mapping but
rather including second addition operation.

Fix it by introducing coff_sectalign_flags helper.
This also allow us to use this helper for getting
rid of open coded computation as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agocoff: Use predefined macros instead of numbers and style fix
Cyrill Gorcunov [Thu, 22 Apr 2010 10:25:21 +0000 (14:25 +0400)]
coff: Use predefined macros instead of numbers and style fix

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoilog2: Use ROUND helper
Cyrill Gorcunov [Thu, 22 Apr 2010 06:29:19 +0000 (10:29 +0400)]
ilog2: Use ROUND helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoilog2: Get rid of tabs
Cyrill Gorcunov [Thu, 22 Apr 2010 06:06:13 +0000 (10:06 +0400)]
ilog2: Get rid of tabs

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agopecoff.h: Complete header
Cyrill Gorcunov [Thu, 22 Apr 2010 05:32:22 +0000 (09:32 +0400)]
pecoff.h: Complete header

Put in all constants pecoff v8 states. Most probably we
will never need most of them but lets have them here for
completeness.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoRemove open-coded ilog2() implementations
H. Peter Anvin [Wed, 21 Apr 2010 23:46:57 +0000 (16:46 -0700)]
Remove open-coded ilog2() implementations

When we need integer log2, use the new library routine.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoAdd generic ilog2 functions
H. Peter Anvin [Wed, 21 Apr 2010 23:43:20 +0000 (16:43 -0700)]
Add generic ilog2 functions

Add ilog2_{32,64}() and alignlog2_{32,64}() ... the latter is intended
for alignment statements and return -1 for non-power-of-2 other than 0
(which returns 0).

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoMakefile: clean up the lib directory on make clean
H. Peter Anvin [Wed, 21 Apr 2010 23:40:38 +0000 (16:40 -0700)]
Makefile: clean up the lib directory on make clean

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agostandard.mac: Update section alignment on align call
Cyrill Gorcunov [Wed, 21 Apr 2010 19:52:57 +0000 (23:52 +0400)]
standard.mac: Update section alignment on align call

Achieved via sectalign call. Note that not all output
targets (ie formats) may handle sectalign yet, most
of them just ignore this entity.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agocoff: Use predefined macro in common section flags
Cyrill Gorcunov [Wed, 21 Apr 2010 18:40:11 +0000 (22:40 +0400)]
coff: Use predefined macro in common section flags

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agocoff: Use predefined macro and eliminate open coded constants
Cyrill Gorcunov [Wed, 21 Apr 2010 18:03:33 +0000 (22:03 +0400)]
coff: Use predefined macro and eliminate open coded constants

Not all are covered but process initiated.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agopecoff.h: Add more constants
Cyrill Gorcunov [Wed, 21 Apr 2010 17:47:03 +0000 (21:47 +0400)]
pecoff.h: Add more constants

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agomake: Update pecoff.h related deps
Cyrill Gorcunov [Wed, 21 Apr 2010 14:51:14 +0000 (18:51 +0400)]
make: Update pecoff.h related deps

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agopecoff: Update machine types
Cyrill Gorcunov [Wed, 21 Apr 2010 14:46:27 +0000 (18:46 +0400)]
pecoff: Update machine types

Update up to pecoff v8

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agooutput: Introduce pecoff.h
Cyrill Gorcunov [Wed, 21 Apr 2010 12:38:56 +0000 (16:38 +0400)]
output: Introduce pecoff.h

Better to have common constants grouped.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agocoff: Implement sectalign handler
Cyrill Gorcunov [Wed, 21 Apr 2010 11:45:09 +0000 (15:45 +0400)]
coff: Implement sectalign handler

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoRename SEGALIGN to SECTALIGN
Cyrill Gorcunov [Wed, 21 Apr 2010 09:45:32 +0000 (13:45 +0400)]
Rename SEGALIGN to SECTALIGN

"sectalign" is preferred over "segalign"
since it operates over section attributes.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agosmartalign.mac: align macro should align a segment as well
Cyrill Gorcunov [Tue, 20 Apr 2010 21:22:31 +0000 (01:22 +0400)]
smartalign.mac: align macro should align a segment as well

This change may have backward compatibility issue but
most probably the sane program never used sections with
base address less then instruction alignment.

Note that alignment may only increase which means if a
section is aligned on 2^5 the align 2^4 will not affect
the section.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoElf64: Implement segalign handler
Cyrill Gorcunov [Tue, 20 Apr 2010 21:15:28 +0000 (01:15 +0400)]
Elf64: Implement segalign handler

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoElf-32: Implement segalign handling
Cyrill Gorcunov [Tue, 20 Apr 2010 21:05:13 +0000 (01:05 +0400)]
Elf-32: Implement segalign handling

Via elf_segalign helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoofmt: Implement null_segalign stubs
Cyrill Gorcunov [Tue, 20 Apr 2010 20:51:22 +0000 (00:51 +0400)]
ofmt: Implement null_segalign stubs

Set stubs for all targets

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoIntroduce SEGALIGN directive
Cyrill Gorcunov [Tue, 20 Apr 2010 11:33:45 +0000 (15:33 +0400)]
Introduce SEGALIGN directive

No real handling yet though. Definition only.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agolabels.c: lookup_label -- should return bool unconditionally
Cyrill Gorcunov [Tue, 20 Apr 2010 11:26:08 +0000 (15:26 +0400)]
labels.c: lookup_label -- should return bool unconditionally

Better to not put return under condition. It was bad.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agosmartalign: Introduce nojmp mode
Cyrill Gorcunov [Tue, 20 Apr 2010 11:06:44 +0000 (15:06 +0400)]
smartalign: Introduce nojmp mode

This allows to force nasm to generate multibyte
NOPs without jmp injected.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoElf: Rename SEG_ALIGN to SEC_FILEALIGN
Cyrill Gorcunov [Tue, 20 Apr 2010 11:05:02 +0000 (15:05 +0400)]
Elf: Rename SEG_ALIGN to SEC_FILEALIGN

It's Elf specifics. To not mess with segment alignment.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoAdd "win" alias for "win32" output format
Cyrill Gorcunov [Tue, 20 Apr 2010 10:55:53 +0000 (14:55 +0400)]
Add "win" alias for "win32" output format

We already have "elf" and "macho" aliases for respective
32 bit output formats. Make the same for "win32" in a
sake of consistency.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agonasm.c: Delete redundant goto
Cyrill Gorcunov [Tue, 20 Apr 2010 10:53:44 +0000 (14:53 +0400)]
nasm.c: Delete redundant goto

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoElf: switch section_attrib to a new nasm_opt_val interface
Cyrill Gorcunov [Sun, 11 Apr 2010 09:12:20 +0000 (13:12 +0400)]
Elf: switch section_attrib to a new nasm_opt_val interface

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agonasmlib.c: Make nasm_opt_val robust
Cyrill Gorcunov [Sun, 11 Apr 2010 09:00:58 +0000 (13:00 +0400)]
nasmlib.c: Make nasm_opt_val robust

nasm_opt_val should be able handle various text stream
passed, including tainted ones. Make it so.

Also it fixes the case when Elf section has multiple
attributes such as "progbits align=16" and friends
(introduced by commit bb0745f). The former just ignore
any other options/values except first one.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agonasmlib.c: Introduce nasm_get_word helper
Cyrill Gorcunov [Sat, 10 Apr 2010 21:03:20 +0000 (01:03 +0400)]
nasmlib.c: Introduce nasm_get_word helper

For easier space separated words extraction
from a text stream.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoElf: Use SHA_ANY constant instead of open coded number
Cyrill Gorcunov [Sat, 10 Apr 2010 10:58:39 +0000 (14:58 +0400)]
Elf: Use SHA_ANY constant instead of open coded number

SHA_ANY is not part of Elf specification but rather our own symbolic
definition for convenience.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoexpand_mmacro: Use list helpers
Cyrill Gorcunov [Fri, 9 Apr 2010 11:43:03 +0000 (15:43 +0400)]
expand_mmacro: Use list helpers

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agodetoken: Use list_for_each helpers
Cyrill Gorcunov [Fri, 9 Apr 2010 11:41:48 +0000 (15:41 +0400)]
detoken: Use list_for_each helpers

And a few style nits.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoexpand_smacro: stylish nits
Cyrill Gorcunov [Fri, 9 Apr 2010 11:40:35 +0000 (15:40 +0400)]
expand_smacro: stylish nits

- no need to split functions even if it a bit longer
  then 80 characters, it becomes hard to read it

- initialize "thead" before "tail" is more natural

- use more simple while() instead of for() with a
  long initializer

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoofmt: Introduce output format aliases
Cyrill Gorcunov [Fri, 9 Apr 2010 11:12:13 +0000 (15:12 +0400)]
ofmt: Introduce output format aliases

This allow us to keep compatibility layer without
needing the separated struct ofmt for this and
elf_init_hack routine.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoElf: Some unification snippets for 32/64 bit versions
Cyrill Gorcunov [Fri, 9 Apr 2010 10:57:28 +0000 (14:57 +0400)]
Elf: Some unification snippets for 32/64 bit versions

Nothing serious, comments and style movements.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoElf: Merge WRITE_STAB to outelf.h
Cyrill Gorcunov [Fri, 9 Apr 2010 10:23:57 +0000 (14:23 +0400)]
Elf: Merge WRITE_STAB to outelf.h

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoElf: Drop never used SOC helper
Cyrill Gorcunov [Fri, 9 Apr 2010 10:21:45 +0000 (14:21 +0400)]
Elf: Drop never used SOC helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agonasmdoc.src: Refer to ..imagebase in special symbols area
Cyrill Gorcunov [Fri, 9 Apr 2010 09:57:14 +0000 (13:57 +0400)]
nasmdoc.src: Refer to ..imagebase in special symbols area

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agonasmlib: Do not hang on if log file creation has been failed
Cyrill Gorcunov [Fri, 9 Apr 2010 09:29:38 +0000 (13:29 +0400)]
nasmlib: Do not hang on if log file creation has been failed

In case if we can't open "malloc.log" for writing
we should not hang out but rather switch to stderr
and continue processing.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoElf: Introduce section_attrib helper
Cyrill Gorcunov [Fri, 9 Apr 2010 09:24:35 +0000 (13:24 +0400)]
Elf: Introduce section_attrib helper

In a sake of removing code duplication.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agonasmlib: Introduce nasm_trim_spaces and nasm_opt_val helpers
Cyrill Gorcunov [Fri, 9 Apr 2010 09:17:23 +0000 (13:17 +0400)]
nasmlib: Introduce nasm_trim_spaces and nasm_opt_val helpers

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agodirectives.pl: trivial formatting fix
H. Peter Anvin [Wed, 7 Apr 2010 23:56:24 +0000 (16:56 -0700)]
directives.pl: trivial formatting fix

Fix whitespace alignment.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agonasm.c: smarter handling of missing directives
H. Peter Anvin [Wed, 7 Apr 2010 23:54:56 +0000 (16:54 -0700)]
nasm.c: smarter handling of missing directives

If we get D_unknown, we definitely don't need to pass it to the
backend for analysis.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agodirectives.pl: compensate for *two* specials, not just one
H. Peter Anvin [Wed, 7 Apr 2010 23:53:33 +0000 (16:53 -0700)]
directives.pl: compensate for *two* specials, not just one

We need to compensate the index for two specials, not just one.  While
we're at it, actually derive the number of specials from the list.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoDistinguish no directive present from unknown directive
H. Peter Anvin [Wed, 7 Apr 2010 00:00:12 +0000 (17:00 -0700)]
Distinguish no directive present from unknown directive

Distinguish the case of no directive present (D_none) from the case of
an unknown specified directive (D_unknown).  This is reflected in
different error messages.

Furthermore, change the special case symbols to lower case in case we
ever have a directive called [none] or [unknown].

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoBR2979629: vsnprintf: Use nasm_malloc
Cyrill Gorcunov [Wed, 31 Mar 2010 21:17:00 +0000 (01:17 +0400)]
BR2979629: vsnprintf: Use nasm_malloc

There is no nasm_malloc_error helper anymore.
Use nasm_error instead.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agovsnprintf: Style nitfix
Cyrill Gorcunov [Wed, 31 Mar 2010 21:09:35 +0000 (01:09 +0400)]
vsnprintf: Style nitfix

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoBR2975768: Update AMD LWP instructions to match upcoming changes
Cyrill Gorcunov [Wed, 24 Mar 2010 21:37:09 +0000 (00:37 +0300)]
BR2975768: Update AMD LWP instructions to match upcoming changes

The former changes have been committed to binutils.
From initial message:

|
| 2010-03-22 Quentin Neill <quentin.neill@amd.com>
|           Sebastian Pop  <sebastian.pop@amd.com>
|
| opcodes/
| * i386-dis.c (OP_LWP_I): Removed.
| (reg_table): Do not use OP_LWP_I, use Iq.
| (OP_LWPCB_E): Remove use of names16.
| (OP_LWP_E): Same.
| * i386-opc.tbl: Removed 16bit LWP insns.  32bit LWP insns
| should not set the Vex.length bit.
| * i386-tbl.h: Regenerated.
|
| gas/
| * testsuite/gas/i386/x86-64-lwp.s: Remove use of 16bit LWP insns.
| * testsuite/gas/i386/lwp.s: Same.
| * testsuite/gas/i386/x86-64-lwp.d: Updated.
| * testsuite/gas/i386/lwp.d: Updated.
|

So there is no 16 bit instructions anymore.
Also xop.l field should be set to 0.

Based on patch from nasm64developer

Reported-by: nasm64developer
Signed-off-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoBR 2496848: Tighten ea checks
Victor van den Elzen [Sun, 24 Jan 2010 20:24:57 +0000 (21:24 +0100)]
BR 2496848: Tighten ea checks

Check if the offset and the representation are equivalent.

Disallow REL on absolute addresses.
I'm not sure what that would mean and the output formats don't support it.

Warn about ignored displacement size modifiers.

14 years agoNASM 2.08.01
Victor van den Elzen [Wed, 10 Mar 2010 22:18:57 +0000 (23:18 +0100)]
NASM 2.08.01

14 years agopreproc.c: Fix regression introduced in bebf0d215
Victor van den Elzen [Wed, 10 Mar 2010 21:33:48 +0000 (22:33 +0100)]
preproc.c: Fix regression introduced in bebf0d215

14 years agoNASM 2.08
Cyrill Gorcunov [Wed, 10 Mar 2010 20:46:06 +0000 (23:46 +0300)]
NASM 2.08

14 years agodoc/changes.src: Restore empty line.
Cyrill Gorcunov [Wed, 3 Mar 2010 20:15:25 +0000 (23:15 +0300)]
doc/changes.src: Restore empty line.

Due to previous commit empty line was occasionally
removed which make text harder to read. Restore it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoUpdate doc/changes.src
Cyrill Gorcunov [Wed, 3 Mar 2010 20:13:48 +0000 (23:13 +0300)]
Update doc/changes.src

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agomisc/tag-release: Make it usable for remote repos
Cyrill Gorcunov [Wed, 3 Mar 2010 19:36:22 +0000 (22:36 +0300)]
misc/tag-release: Make it usable for remote repos

In case if the commiter has a main repo configured as remote
one and also has various tags (and don't want to push every
tag he has out to the main repo) he may use misc/tag-release
new functionality.

For example I have NASM remote repo as well known

git://repo.or.cz/nasm.git

and a number of my own local tags/branches which I
would like to not sprinkle into a master repo.

So to make a release (say 2.08) I may just type

misc/tag-release 2.08 git+ssh://xxx@repo.or.cz/srv/git/nasm.git master

and this command will push master branch into main repo with "nasm-2.08" tag.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoNASM 2.08rc10
Cyrill Gorcunov [Sun, 28 Feb 2010 21:56:01 +0000 (00:56 +0300)]
NASM 2.08rc10

We decided to defer recursive macro support
for now.

Hope this is the last RC before 2.08 final release.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agopreproc.c: Turn off rmacro,exitmacro support
Cyrill Gorcunov [Sun, 28 Feb 2010 08:52:53 +0000 (11:52 +0300)]
preproc.c: Turn off rmacro,exitmacro support

We've a problem in supporting [i]rmacro, exitmacro
facilities at moment.

In a sake of not holding new NASM release any longer these
directives are just marked as being "forbidden".

This allow us to not squash much changes in current source
code base but remain on a safe side same time.

Reviewed-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agophash.ph: we haven't required the Graph module for a long time
H. Peter Anvin [Thu, 18 Feb 2010 18:36:21 +0000 (10:36 -0800)]
phash.ph: we haven't required the Graph module for a long time

We removed the need for the Graph module back at checkin
c593173e110244f99a3498cb3e23d6c3c07bae35 in 2008.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agolabels.c: Fix NULL dereference on too long identifiers
Cyrill Gorcunov [Thu, 18 Feb 2010 16:06:14 +0000 (19:06 +0300)]
labels.c: Fix NULL dereference on too long identifiers

In case if label is local and exceed maximum allowed length
we get NULL dereference. Fix it and warn a user about an accident.

Note that we don't print identifier itself since we know it's too
big. Line number of error is enough.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoRevert "doc/nasmdoc.src: Get rid of id length restriction"
Cyrill Gorcunov [Tue, 16 Feb 2010 22:16:00 +0000 (01:16 +0300)]
Revert "doc/nasmdoc.src: Get rid of id length restriction"

This reverts commit 3012d5d430b64273b83f4b5890719d34e441a18c.

nasm64developer pointed out that we still have this
limit in label.c (IDLEN_MAX).

Reported-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agopreproc.c: Eliminate parasite comment on PP_STACKSIZE
Cyrill Gorcunov [Tue, 16 Feb 2010 07:42:33 +0000 (10:42 +0300)]
preproc.c: Eliminate parasite comment on PP_STACKSIZE

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agopreproc.c: Fix tab\space mess
Cyrill Gorcunov [Tue, 16 Feb 2010 07:27:56 +0000 (10:27 +0300)]
preproc.c: Fix tab\space mess

It's really hard to read the code which is
terribly messed in tabs\spaces. Fix it all
at once. It's dirty work but has to be done
once.

No change on binary level.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agodoc/nasmdoc.src: Get rid of id length restriction
Cyrill Gorcunov [Tue, 16 Feb 2010 10:45:27 +0000 (13:45 +0300)]
doc/nasmdoc.src: Get rid of id length restriction

We always allocate enough memory to hold identifiers
with any length. So lets remove restriction from
documentation.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agodoc/nasmdoc.src: Point to the correct license file
Cyrill Gorcunov [Tue, 16 Feb 2010 10:18:04 +0000 (13:18 +0300)]
doc/nasmdoc.src: Point to the correct license file

There is no "COPYING" but "LICENSE" file.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agodoc/nasmdoc.src: It's 2010 already
Cyrill Gorcunov [Tue, 16 Feb 2010 10:17:10 +0000 (13:17 +0300)]
doc/nasmdoc.src: It's 2010 already

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoNASM 2.08rc9
H. Peter Anvin [Mon, 15 Feb 2010 18:16:18 +0000 (10:16 -0800)]
NASM 2.08rc9

14 years agodoc/changes.src: update in preparation of 2.08 release
H. Peter Anvin [Mon, 15 Feb 2010 18:15:53 +0000 (10:15 -0800)]
doc/changes.src: update in preparation of 2.08 release

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agopreproc.c: Fix SIGSEV on missed %endm
Cyrill Gorcunov [Sun, 14 Feb 2010 14:19:38 +0000 (17:19 +0300)]
preproc.c: Fix SIGSEV on missed %endm

In case if EOF is reached (or due to any
other case pp_cleanup is being called) we
do free "defining" macro but forgot to set
pointer to NULL itself which leads to attempt
to free memory again for this macro on further
pp_cleanup calls.

14 years agopreproc.c: Fix NULL dereference on package absence
Cyrill Gorcunov [Fri, 12 Feb 2010 19:00:18 +0000 (22:00 +0300)]
preproc.c: Fix NULL dereference on package absence

If package can't be retrieved we should not attempt
to dereference NULL'ed pointer which leads to segmentation
fault.

Reported-by: Serge
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoNASM 2.08rc8
Cyrill Gorcunov [Thu, 11 Feb 2010 19:11:16 +0000 (22:11 +0300)]
NASM 2.08rc8

14 years agooutput/outbin.c: Fix misprinted alignment bound
Cyrill Gorcunov [Thu, 11 Feb 2010 18:49:58 +0000 (21:49 +0300)]
output/outbin.c: Fix misprinted alignment bound

Due to a misprint in commit
9b66d8e4c3030474a75e598f699eccc118a3d651

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoexpand_smacro: Don't search for ID in global context
Cyrill Gorcunov [Thu, 11 Feb 2010 12:12:19 +0000 (15:12 +0300)]
expand_smacro: Don't search for ID in global context

The corner case is the code like

%define foo 1
%push bar
%$foo:
%pop

for which v2.07 ends up with "foo = 1" while 0.98.39
issue an error.

hpa said that ideally we may need to create a context
structure for the global context but this seems to be
too agressive for 2.08.

Based on patch from nasm64developer

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoElf: Drop useless SEG_ALIGN_1
Cyrill Gorcunov [Thu, 11 Feb 2010 18:24:39 +0000 (21:24 +0300)]
Elf: Drop useless SEG_ALIGN_1

No need for SEG_ALIGN_1 since we have switched
to ALIGN helper.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoUse ALIGN helper
Cyrill Gorcunov [Thu, 11 Feb 2010 18:23:50 +0000 (21:23 +0300)]
Use ALIGN helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agonasmlib.h: Introduce ALIGN helpers
Cyrill Gorcunov [Thu, 11 Feb 2010 06:03:51 +0000 (09:03 +0300)]
nasmlib.h: Introduce ALIGN helpers

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agopreproc.c: Use 16 byte offset in "flat64" stack model
Per Jessen [Wed, 10 Feb 2010 21:16:59 +0000 (00:16 +0300)]
preproc.c: Use 16 byte offset in "flat64" stack model

The first argument passed on stack with "flat64" stack model
(stack frame with base pointer) should be pointed by
[rbp + 16].

Signed-off-by: Per Jessen <per@computer.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agodoc/nasmdoc.src: Delete misplaced "point" sign
Cyrill Gorcunov [Wed, 10 Feb 2010 20:31:03 +0000 (23:31 +0300)]
doc/nasmdoc.src: Delete misplaced "point" sign

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agocontrib/MSVC6.txt: Add guide how to use nasm in MSVC6
Alexander Ilyin [Sun, 24 Jan 2010 20:14:39 +0000 (23:14 +0300)]
contrib/MSVC6.txt: Add guide how to use nasm in MSVC6

It's possible to use nasm as asm compiled right within
MSVC6 IDE. Lets point it out via a small guide.

Signed-off-by: Alexander Ilyin <dragity@mail.ru>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>