BR 3392279: Fix duplicated REX prefixes

The fix for BR 3392278:

aa29b1d93f5a assemble.c: Don't drop rex prefix from instruction itself

... would cause multiple REX prefixes to be emitted for some
instructions.  Create a new flag to indicate that REX has already been
emitted, which can be cleared for each instance of an instruction.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
doc: Document --v and duplicate REX prefix fix

Document changes for 2.11.05.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
NASM 2.11.05
Merge branch 'nasm-2.11.xx'

Resolved Conflicts:
	assemble.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
doc: Make it clear that --v is only in 2.11.05 and newer

... otherwise people might think it is preferred and use it
unnecessarily.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Merge branch 'nasm-2.11.xx'
output: outbin -- Fix relocation size

In commit fd52c277dd6d768545cee39b154e706904581966
we've started handling negative address relocations
but support Elf format only and got a typo in bin
format which leaded to endless cycle of applying
relocation due to negative argument (make test
hangs).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
preproc: Convert tabs to spaces

No func cnages

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
preproc: Use nasm_zalloc in new_Block

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
preproc: pp_cleanup -- Don't forget to zeroify variables

Once we free allocated memory don't forget to setup variables
to NULL, otherwise they are pointing into nonexisting memory,
which might lead into sigsegv in best case.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
nasm: Make op_type members being capitals

Otherwise they look like reguar variables.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
nasm: Convert operating_mode to use bitmask

We will need it to handle mode continuations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
nasm: Handle -MF and -MD options

It's been long time since -MF and -MD options were described
in docs but actually -MF was not implemented completely and -MD
didn't proceed into normal compilation process. Fix it.

Because we use bitmask for operating_mode selection I had to
move compilation condition one shift left.

http://bugzilla.nasm.us/show_bug.cgi?id=3392280

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
msvc.mak: Update insns.pl arguments

45a22d9a6147c320b6754679de54a8290de3c5e3 changes the arguments of insns.pl
and adds a new autogenerated header iflaggen.h. Update the nmake Makefile
accordingly.

Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
assemble.c: Introduce mnemonics into bytecode spec

There are a number of mnemonics used in instns.pl plus
insns.dat files, lets document them.

This is first attempt to document mnemonics, so something
might be still missing, need review and updates.

No functional changes.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
insns: Move 'np' mnemonic into @plain_codes

This is literal mnemonic so no need to special
handling, move it to @plain_codes instead.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
output: elf -- Rename section_attrib to elf_section_attrib

Global section_attrib name is too general.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
output: elf -- Move elf_directive into single instance

For all Elf32/32x/64 this routine is the same. So lets
merge it into one instance.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
output: elf -- Move common structures into outelf.h header

All Elf formats we're supporting at the moment have
are using same structures, move them into a header
and name then with elf_ prefix.

This makes a few fields to carry 64 bit integers while
in former Elf32|x formats they can be 32 bit wide, but
I think it's acceptable tradeoff.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
output: elf -- Use common elf_ structures

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>