Commit Graph

3047 Commits

Author SHA1 Message Date
H. Peter Anvin
724719b1da Change posix_mktime() to make_posix_time()
The posix_ prefix is reserved for POSIX, and even if there never is a
posix_mktime() defined it might be confusing for programmers familiar
with this convention.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2015-01-05 15:17:56 -08:00
Cyrill Gorcunov
7cc90badae quote: Fix returning out of string pointer, take 2
In commit a45febd767 only part of problem has been covered.
Need to be ready for strings like

 | `a

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

Reported-by: Hanno Boeck <hanno@hboeck.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-12-20 15:07:39 +03:00
Cyrill Gorcunov
85ec505d05 doc: Add missing closing brace
http://bugzilla.nasm.us/show_bug.cgi?id=3392284

Reported-by: Nick Rowan <nnrowan@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-12-20 14:25:58 +03:00
Cyrill Gorcunov
1006a47fe8 disasm: Add explicit type conversion to placate compiler
Otherwise getting

 | disasm.c:200:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 |         return GET_REGISTER(nasm_rd_bndreg, regval);

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-12-20 11:40:36 +03:00
Cyrill Gorcunov
7729edf722 configure.in: Move AC_C_INLINE and friends to be checked before PA_ADD_CFLAGS
Looks like -Werror=missing-declarations revealed problem in
configure: the "inline" support has not been detected properly
leading to problem in building procedure.

Lets move AC_C_INLINE and etc to be tested before gcc flags.

Reported-by: NAKAI Yuta <nak5124@live.jp>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-12-20 11:35:51 +03:00
Cyrill Gorcunov
9b05974022 ndisasm: Prevent nil dereference on registerd decoding
The sequence | 0x0F 0x1B 0x75 | get matched into
one of BNDx instruction which register value 6
which is of course out of possible BND registers
implemented in hardware at the moment leading to
nil dereference.

Instead lets use a macro in whichreg() helper
which would test the registers bounds and force
the caller to try another template if register is
out of range. In the case above it simply means
ndisasm instead of crashing outputs

 | 00000000  0F                db 0x0f
 | 00000001  1B                db 0x1b
 | 00000002  75                db 0x75

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

Reported-by: Hanno Boeck <hanno@hboeck.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-12-14 22:44:54 +03:00
Cyrill Gorcunov
1cccb1e8d5 disasm: matches -- Use proper return type
matches() declared as int and better return explicit
zero here instead of @false.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-12-14 10:57:53 +03:00
Cyrill Gorcunov
00590792fe NASM 2.11.07
A few changes here

 - fix in VMOVNTPS 256 bit encoding
 - fix nil dereference in memory parsing code
   and access to uninitialized space when handling
   strings
 - fix processing of -MD option, the commit 599a982
   was fixing one issue but occasionally broke visible
   command line api, leading to (for example) syslinux
   can't be built with previous version.

There are some more bugs which are to be addressed
but due to fix of -MD option we need to release update.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-12-09 21:52:09 +03:00
Cyrill Gorcunov
e3131143fa doc: Update changes for 2.11.07
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-12-09 21:47:23 +03:00
Henrik Gramner
e7072c4148 insns.dat: Fix 256-bit vmovntps
Signed-off-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-11-30 00:21:17 +03:00
Cyrill Gorcunov
0dd37af210 nasm: Fix -MD operating mode
Previously -MD option didn't call for depend mode solely but
produced deps during active compilation phase allowing symbol
refereces processing as well.

Occasionally in commit 599a98 I made -MD option to handle deps
in a separate internal phase which caused problems like

 | error: symbol references not supported in preprocess-only mode

leading to problems in building applications with nasm. Fix it
moving old behaviour back.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-11-29 21:49:38 +03:00
Cyrill Gorcunov
b2c3449788 compiler: Fix typo for HAVE__VSNPRINTF
Reported-by: Michael Murashkin <ragnarokkx@inbox.ru>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2014-11-26 10:44:19 +03:00
H. Peter Anvin
cfe039f69b configure.in: Remove redundant -Werror=trigraphs
As obnoxious as trigraphs are, we don't need to -Werror them twice.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 13:05:32 -08:00
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