Commit graph

1701 commits

Author SHA1 Message Date
H. Peter Anvin
25e65498af Macro file copyright header 2009-06-28 17:14:51 -07:00
H. Peter Anvin
9e6747ccac Add copyright headers to the *.c/*.h files in the main directory
Add copyright headers to the *.c/*.h files in the main directory.  For
files where I'm sure enough that we have all the approvals, I have
given them the 2-BSD license, the others have been given the "LGPL for
now" license header.  Most of them can probably be changed after
auditing.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 17:13:04 -07:00
H. Peter Anvin
c940afc103 In memory of Chuck...
Let the 2.06 release be in memory of Chuck.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 17:12:37 -07:00
H. Peter Anvin
8e471da71d Add copyright header to nasmdoc.src
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 17:00:48 -07:00
H. Peter Anvin
ccaf22e4b1 LICENSE: include the actual BSD license 2009-06-28 16:59:47 -07:00
H. Peter Anvin
6373d98cf4 Add copyright notices to other *.dat files
Add copyright notices to the other *.dat files.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 16:58:10 -07:00
H. Peter Anvin
7704c186b3 Add copyright notice to insns.dat 2009-06-28 16:56:19 -07:00
H. Peter Anvin
e6ee1a859b Add copyright verbiage to Perl scripts; update LICENSE
This adds copyright verbiage to the Perl scripts.  Scripts that are
known to be clean w.r.t. the 2-clause BSD license are given that
license; unclear ones are given the "LGPL for now".

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 16:54:44 -07:00
H. Peter Anvin
5c82b12169 Standard copyright verbiage headers 2009-06-28 16:50:50 -07:00
H. Peter Anvin
9f0abf5af6 LICENSE: give the current license status. 2009-06-28 16:34:15 -07:00
H. Peter Anvin
46aa84d62c NASM 2.06rc16 2009-06-28 00:05:26 -07:00
H. Peter Anvin
dcd6c5d877 Run make alldeps 2009-06-27 22:16:33 -07:00
H. Peter Anvin
69925e5b78 Move prototypes for null_debug to outform.h and outlib.h
Move the prototypes for the null debugging format to outform.h (for
the top-level structure declaration only) and outlib.h (for the
internal routines.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 22:15:25 -07:00
H. Peter Anvin
31b707bef0 Move backend-specific code to output/; break out null debug stuff
Move backend-specific code into the output/ directory, and make the
null debugging backend a separate file (it certainly isn't needed for
ndisasm...)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 22:07:33 -07:00
H. Peter Anvin
2b1f51f1ca debug: make *all* the null debug routines available as a library
Make all the null debug routines available as a library, so we can use
them whenever appropriate.  We really don't need to have a bunch of
dummy functions scattered all over the code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 21:58:21 -07:00
H. Peter Anvin
2d115448b4 output: call debug init from a central location
We already call current_dfmt->init in the same place (at the very end
of ofmt->init) in all the backends that do it; instead call it
centrally in nasm.c after ofmt->init.

This fixes invalid ELF files with when compiling with -F dwarf, since
the dwarf initialization routine never got called.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 21:55:31 -07:00
H. Peter Anvin
5ca5007695 test/Makefile: add rule to produce a .dbg file
Add a rule to produce a .dbg file, that is, a dump of all the calls to
the back end.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 21:28:09 -07:00
H. Peter Anvin
0674292c66 outform: build ALL formats by default, including DBG
There really is no point to ever excluding a backend anymore... all it
leads to is bitrot.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 21:12:13 -07:00
H. Peter Anvin
0638193769 outelf.c: add appropriate #ifdefs
Only build outelf.c if ELF32 or ELF64 is included.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 21:10:09 -07:00
H. Peter Anvin
28abe7ada5 outdbg: make outdbg.c compile cleanly
Make outdbg.c compile cleanly again.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 21:05:42 -07:00
H. Peter Anvin
b2a2ba23f0 NASM 2.06rc15 2009-06-27 16:32:55 -07:00
H. Peter Anvin
aeb0e0e9f1 BR 2781900: handle common labels while optimizing
When optimizing, we have to keep track of common labels, since a
common symbol cannot be optimized -- only the linker will know where
it will end up.  In that sense it is similar to an EXTERN symbol.

Thus, allow them to be entered in the symbol table but make sure we
don't holler too hard on redefinition.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 16:30:00 -07:00
H. Peter Anvin
3512d71748 parser.c: fix stylistic nitpick
Fix stray blank line in parser.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 16:26:25 -07:00
H. Peter Anvin
4a5a6dfed0 assemble.c: stylistic nitpick
Fix stylistic nitpick

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 16:14:18 -07:00
H. Peter Anvin
18f48793a9 preproc: use %if 0 instead of %ifdef BOGUS
When processing an unparsable TASM argument, convert it to %if 0 which
is guaranteed to not happen, rather than %ifdef BOGUS.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 15:56:27 -07:00
H. Peter Anvin
eac7892834 hashtbl: make hash_iterate() not crash on an uninitalized table
Trying to walk an uninitialized table (->table == NULL) should just
return nothing.  This can happen due when pp_cleanup() is called after
a failure.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 15:54:25 -07:00
H. Peter Anvin
f7a9ecaffa nasm.c: clean up pass exit logic
Clean up the pass exit logic.  In particular, we had a whole routine
to do the same thing that the normal exit logic would do anyway if we
only would actually get there.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 15:34:32 -07:00
H. Peter Anvin
d28f07f7e3 ndisasm: fix disassembly of JRCXZ
Fix the disassembly of JRCXZ; in 64-bit mode, we should only accept
JECXZ for disassembly with 32-bit address size override.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-26 16:18:00 -07:00
H. Peter Anvin
b9893413ec NASM 2.06rc14 2009-06-26 15:15:46 -07:00
H. Peter Anvin
898fceb86d insns.dat: reformat
Reformat insns.dat with standard formatting

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-26 15:14:58 -07:00
H. Peter Anvin
6f5bcf114d insns.dat: add relaxed forms for XOP/FMA4/CVT16 instructions
Add relaxed forms of the XOP/FMA4/CVT16 instructions, without looking
too hard at if it makes sense.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-26 15:13:36 -07:00
H. Peter Anvin
9f01c1db4a Add Cyrill Gorcunov to AUTHORS 2009-06-26 14:57:33 -07:00
H. Peter Anvin
98df21629a insns.pl: remove stray whitespace
Clean up whitespace in insns.pl.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 23:18:06 -07:00
H. Peter Anvin
51c7de27e8 insns.pl: add "nohi" code for REX_NH
Add a "nohi" code flag for the \325 byte code, which sets the REX_NH
flag.  That is, REX_P not required to support high registers, high
registers are not supported and spl/bpl/sil/dil enabled even in
non-64-bit mode.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 23:17:52 -07:00
H. Peter Anvin
f5051691c9 insns.pl: fix indentation
Canonicalize indentation of some blocks.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 23:17:52 -07:00
H. Peter Anvin
a564a02788 ELF: make debugging functions static
The debugging functions can and should all be static.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 17:43:54 -07:00
H. Peter Anvin
ca2a788edf ELF: remove loop invariant calculation of global offset
The global symbol offset is a loop invariant; no need to compute it
over and over.  The compiler probably will not be able to do this for
us due to global variables and function calls.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 17:30:58 -07:00
H. Peter Anvin
559d936ad7 ELF: clean up the arithmetic for global symbols
Clean up the arithmetic for global symbols; in particular, make it
clear where the dependency on the debug format comes from (DWARF needs
three symbol table entries all by itself.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 17:26:43 -07:00
H. Peter Anvin
3716238058 ELF: bump GLOBAL_TEMP_BASE
Bump GLOBAL_TEMP_BASE so far that it *cannot* conflict for ELF32
(which has 24-bit symbol table indicies) and is *unlikely* to conflict
for ELF64 (which has 32-bit symbol table indicies.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 17:25:35 -07:00
H. Peter Anvin
c4471462dc ELF: eliminate hard-coded section numbers
Eliminiate hard-coded section numbers, at least to the best of our
ability.  There is still a very odd piece of computation in
elf_build_reltab() which I can't really figure out...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 14:54:44 -07:00
H. Peter Anvin
1acf6ba822 Handle the new ELF headers in the dependency generation
The dependency machinery relies on properly rooted includes, so give
it to them... the path syntax munging machinery in the dependency
script handles it from a Makefile syntax perspective, and then we can
hope that C compilers are smart enough to deal with forward-slash
paths even when that is not the native syntax.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 13:06:49 -07:00
H. Peter Anvin
d219a3e46f ELF: add header files, begin merging common code, drop .comment
Add something approaching real ELF header files.

Begin merging the common ELF code, beginning with the section name
detection.

Drop automatic generation of .comment section, and in particular the
treatment of .common as a special section (if we decide generating
.comment is still a good idea, we should just do it as a macro.)

Augment the list of known sections, and make it table-driven.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 12:30:50 -07:00
H. Peter Anvin
538628803b NASM 2.06rc13 2009-06-25 11:27:18 -07:00
H. Peter Anvin
883735f4c3 changes.src: update 2009-06-25 11:23:37 -07:00
H. Peter Anvin
ef3ef70ccf insns: make the MMX version of PINSRW match the SSE/AVX ones
Make the MMX version of PINSRW match the SSE and AVX ones, and add it
to the tests.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:53:23 -07:00
H. Peter Anvin
d15bb009f6 Intel FMA: drop relaxed forms
The Intel FMA instructions are destructive, so relaxed forms are not
appropriate.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:45:27 -07:00
H. Peter Anvin
1d3e304546 Fix the PINSR series of instructions
Clean up a number of errors in the PINSR series instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:43:04 -07:00
H. Peter Anvin
9472dab6ed Add support for instructions which always use low 8-bit registers
Add a byte code to explicitly support instructions which only uses the
low 8-bit registers (as if a REX prefix always was present.)  This is
usable for instructions which are officially documented as using "the
low byte of a 32-bit register" and so on.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:38:29 -07:00
H. Peter Anvin
f9fc3fde55 insns.dat: fix typos: VCMPORD_SP[SD] entered as VCMPORS_SP[SD]
Fix typos in two instructions in the relaxed forms.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:03:29 -07:00
H. Peter Anvin
79c2e37bc0 insns.dat: collapse relaxed forms
Change the relaxed forms to the compact representation.  This
*deliberately* does not fix bugs where the relaxed form does not match
the official form; this is strictly a "no change in output" checkin.

All remaining open-coded relaxed forms are very likely bugs, and need
to be individually audited.  Furthermore, it is questionable if the
Intel FMA instructions, being destructive, should have relaxed forms
at all.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 18:36:24 -07:00