Commit graph

1860 commits

Author SHA1 Message Date
H. Peter Anvin
396e6dcc4b compiler.h: new macro for a non-returning function
Add a new macro for a non-returning function.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-01 22:01:07 -07:00
H. Peter Anvin
8beadd4da8 outmacho: change license to 2-BSD
Received authorization from Apple to change the license of outmacho.c
to the 2-clause BSD license.  Thanks!

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-30 21:17:07 -07:00
Cyrill Gorcunov
2118261e1a ELF64: fix incorrect type for the .strtab section header
The .strtab section is SHT_STRTAB, not SHT_SYMTAB.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-30 14:09:39 -07:00
H. Peter Anvin
6a9d79f873 NASM 2.06 2009-06-29 18:02:34 -07:00
H. Peter Anvin
454841d2cb headers/doc: copyright header for documentation files 2009-06-28 17:35:08 -07:00
H. Peter Anvin
c8578cec67 Add new copyright headers to the rdoff code
To the best of my knowledge, the only file which we don't have 2-BSD
relicensing permission for at this stage is rdf2ihx.c.  That file
probably should just be rewritten, if anyone cares.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 17:33:50 -07:00
H. Peter Anvin
d7392ad814 Add new copyright headers to the output modules
Add new copyright headers to the new output modules.  As far as I
know, the only module which we still don't have a green light to
release under 2-BSD is outmacho.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 17:25:15 -07:00
H. Peter Anvin
143689d35d Add copyright headers to standard macro packages
These are all recent and written by me.  BSD license them.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 17:18:13 -07:00
H. Peter Anvin
b45b21b411 Add copyright headers to macro files
These are definitely overly restrictive, need auditing to pare them
down to proper BSD licensing.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 17:16:54 -07:00
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