Commit graph

2884 commits

Author SHA1 Message Date
H. Peter Anvin
ad2acd7754 Add missing static declarations in rdoff/segtab.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:35:29 -08:00
H. Peter Anvin
31bcb6f866 Add missing static declarations in rdoff/rdoff.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:35:16 -08:00
H. Peter Anvin
b06da211f4 Add missing static declaration in rdoff/rdlib.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:34:34 -08:00
H. Peter Anvin
48166388d5 Add missing static declarations in rdoff/rdflib.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:34:03 -08:00
H. Peter Anvin
ef18237372 Add missing static declaration in rdoff/rdfdump.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:33:33 -08:00
H. Peter Anvin
236f7949e4 configure.in: promote some C warnings to errors
Promote some C warnings to errors, especially ones relating to missing
prototypes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
H. Peter Anvin
4de7a764d5 Run "make alldeps" to add missing header file dependencies
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
H. Peter Anvin
2bbe917ede Add missing prototype in tokhash.c (from tokhash.pl)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
H. Peter Anvin
c9f0447079 Add missing static declarations in rdoff/ldrdf.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
H. Peter Anvin
d4184a0e0f Add missing static declarations in output/outobj.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
H. Peter Anvin
895ac7e53f Add missing static declaration in output/outdbg.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
H. Peter Anvin
443b8e9b5f Add missing static declaration in output/outieee.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
H. Peter Anvin
aa433d738c Add missing static declaration in output/outcoff.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
H. Peter Anvin
c0c67c67c8 Add missing header file in output/nulldbg.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
H. Peter Anvin
c664583b09 Add missing header file in labels.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
H. Peter Anvin
a725d0afd0 Add missing header file in crc64.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
Jim Kukunas
db7d8685c4 nasmlib: Fix typo in fwriteint32_t()
Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
2014-11-25 09:44:00 -08:00
Jim Kukunas
46d606e124 msvc.mak: Add support for generating PDBs for debugging
Adds a new Makefile variable DEBUG that controls whether a symbol file (.PDB)
is created for the executables, e. g., nmake -f Mkfiles\msvc.mak DEBUG=1

Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
2014-11-25 09:43:11 -08:00
Cyrill Gorcunov
a45febd767 quote: Fix returning out of string pointer
In case if string is a single grave accent we
return the pointer to uninitialized space.

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

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-11-23 18:26:54 +03:00
Cyrill Gorcunov
5c0b082c92 parser: Check for eval error before memory reference parsing
If there is an error in evaluate() happened then @value
is NULL so that we better fail with error report instead
of trying processing it.

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

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-11-22 18:20:29 +03:00
Jim Kukunas
e184c0b0cb rdoff: don't check fwritezero() return value.
Since e76a626055, the return type of fwritezero()
is void.

Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
2014-11-10 11:45:10 -08:00
H. Peter Anvin
e76a626055 Replace unchecked fwrite() calls
Instead of having unchecked fwrite() calls, introduce nasm_write()
which does error checking (and fatal errors if the write fails).

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-10-21 12:50:47 -07:00
Jim Kukunas
505de5dc57 NASM 2.11.06 2014-10-17 15:19:41 -07:00
Jim Kukunas
e3e4f7c8fb doc: Document -MF/-MD and updated AVX512 instructions
Document changes for 2.11.06

Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
2014-10-17 15:07:41 -07:00
Mark Charney
dcaef4b095 Sync to public Intel EAS version 021.
* http://www.intel.com/software/isa

   * Signed-off-by: Mark Charney <mark.charney@intel.com>
2014-10-16 16:31:31 -07:00
Cyrill Gorcunov
8a076f4260 output: elf -- Use common elf_ structures
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-09-21 13:05:03 +04:00
Cyrill Gorcunov
c24568b0b0 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>
2014-09-21 13:03:26 +04:00
Cyrill Gorcunov
500dd5461c 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>
2014-08-29 20:30:57 +04:00
Cyrill Gorcunov
9b76c802ae output: elf -- Rename section_attrib to elf_section_attrib
Global section_attrib name is too general.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-08-29 20:24:24 +04:00
Cyrill Gorcunov
8a5d3e68a4 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>
2014-08-25 20:04:30 +04:00
Cyrill Gorcunov
5d488a30a4 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>
2014-08-25 19:32:02 +04:00
Jim Kukunas
2bedd24113 msvc.mak: Update insns.pl arguments
45a22d9a61 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>
2014-08-07 11:42:05 -07:00
Cyrill Gorcunov
599a98272e 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>
2014-06-29 00:52:54 +04:00
Cyrill Gorcunov
e9fc88ca11 nasm: Convert operating_mode to use bitmask
We will need it to handle mode continuations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-06-29 00:52:54 +04:00
Cyrill Gorcunov
3ed32cb288 nasm: Make op_type members being capitals
Otherwise they look like reguar variables.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-06-29 00:52:54 +04:00
Cyrill Gorcunov
dae24d7504 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>
2014-06-29 00:52:54 +04:00
Cyrill Gorcunov
c31767c5cb preproc: Use nasm_zalloc in new_Block
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-06-29 00:52:54 +04:00
Cyrill Gorcunov
4d8dbd98b2 preproc: Convert tabs to spaces
No func cnages

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-06-29 00:52:54 +04:00
Cyrill Gorcunov
6ebe3bcd2e output: outbin -- Fix relocation size
In commit fd52c277dd
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>
2014-06-28 22:31:06 +04:00
H. Peter Anvin
67f0f4d08c Merge branch 'nasm-2.11.xx' 2014-05-21 23:00:31 -07:00
H. Peter Anvin
febd5afc6d 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>
2014-05-21 23:00:12 -07:00
H. Peter Anvin
89f78f5010 Merge branch 'nasm-2.11.xx'
Resolved Conflicts:
	assemble.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-05-21 08:30:40 -07:00
H. Peter Anvin
12f7802d60 NASM 2.11.05 2014-05-21 08:29:41 -07:00
H. Peter Anvin
4ac3b025be doc: Document --v and duplicate REX prefix fix
Document changes for 2.11.05.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-05-21 08:28:21 -07:00
H. Peter Anvin
0a9250c2ab BR 3392279: Fix duplicated REX prefixes
The fix for BR 3392278:

aa29b1d93f 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>
2014-05-21 08:24:21 -07:00
H. Peter Anvin
49de44e56d Merge remote-tracking branch 'origin/signrel' 2014-05-09 15:09:43 -07:00
H. Peter Anvin
61c397caab Merge branch 'nasm-2.11.xx' 2014-05-09 15:09:13 -07:00
Cyrill Gorcunov
13558c1e7c options: Add --v option
It's been requested a long ago to handle '--v' option same was as
a regualar '-v'. From initial report

 | NASM and yasm are in many respects compatible but yasm uses --v
 | instead of -v for version.  As often --v is used for version I
 | end up using --v initially in NASM.  This patch allows me to compile
 | Mozilla apps which use yasm with NASM by merely renaming NASM to yasm
 | so that the build environment does not have to be updated (Mozilla
 | would not accept changes to allow use of NASM).

Reported-by: Andy Willis <abwillis1@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-05-09 15:08:28 -07:00
H. Peter Anvin
39aa094f38 NASM 2.11.04 2014-05-09 15:04:42 -07:00
Cyrill Gorcunov
e743843d15 options: Add --v option
It's been requested a long ago to handle '--v' option same was as
a regualar '-v'. From initial report

 | NASM and yasm are in many respects compatible but yasm uses --v
 | instead of -v for version.  As often --v is used for version I
 | end up using --v initially in NASM.  This patch allows me to compile
 | Mozilla apps which use yasm with NASM by merely renaming NASM to yasm
 | so that the build environment does not have to be updated (Mozilla
 | would not accept changes to allow use of NASM).

Reported-by: Andy Willis <abwillis1@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-05-09 22:34:37 +04:00