Commit graph

225 commits

Author SHA1 Message Date
H. Peter Anvin
4d58a8fef5 Makefile: move all non-main objects into libnasm.a
There is no fundamental reason for all objects that don't contain a
main() function to not be part of libnasm.a; this allows the linker to
do its job optimally, especially in the presence of debugging code
which may not be needed under normal conditions.

If we do end up with function name conflicts the library might have to
be split, but it would be better to simply avoid that case.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-02-28 18:08:21 -08:00
H. Peter Anvin
9222364607 nasmlib/file: move memory-mapping functions out of file.c
Move memory-mapping functions from file.c into a separate mmap.c.
This will be cleaner especially once (if) we end up doing a Windows
implementation, which is likely to look entirely different.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-02-23 18:39:00 -08:00
H. Peter Anvin
f5287231c1 Move canned OpenWatcom config to config/watcom.h.
Move the canned OpenWatcom configuration file to config/watcom.h.
Also exclude config/config.h from being a dependency for MSVC.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-10-19 13:23:04 -07:00
H. Peter Anvin
1fe546cf35 Run make alldeps
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-10-14 15:09:52 -07:00
H. Peter Anvin
c58b4c3c76 distclean: clean up config/config.h
When doing "make distclean", clean config/config.h as config.h has
moved.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-10-06 14:17:38 -07:00
H. Peter Anvin
93c93b0a2e alldeps: handle uses of full pathnames, e.g. "config/config.h"
Sometimes we really want to use an extended pathname for an include
file, for documentation purposes; e.g. "config/config.h".  This makes
alldeps handle that case correctly (and also adds the config/
directory to directories scanned by alldeps).

It is unclear if this will work correctly if there are include files
with the same name in different directories, but we currently do not
have any case like that.

Reported-by: anonymous coward <nasm64developer@users.sf.net>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-10-06 14:12:39 -07:00
H. Peter Anvin
436e367874 Factor out common string list handling code
Simplify the preprocessor code by factoring out the common string list
handling code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-10-04 01:12:28 -07:00
H. Peter Anvin
fa803abc61 backend: move wrapper for legacy output functions to a library routine
Move the wrapper for legacy output into a library routine so the
backends can be ported one at a time.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-09-24 09:46:47 -07:00
H. Peter Anvin
6e01ea2bc6 Run make alldeps
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-08-16 14:48:54 -07:00
Fabian Giesen
6823d01c82 Make "make clean" actually clean all object files.
Signed-off-by: Fabian Giesen <fabiang@radgametools.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-07-18 14:52:27 +03:00
H. Peter Anvin
e1f985c167 Reorganize the source code into subdirectories
Make the source code easier to understand and keep track of by
organizing it into subdirectories depending on the function.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-05-25 12:06:29 -07:00
H. Peter Anvin
22538e2b67 nasmlib: break up nasmlib.c into logical components
nasmlib.c had basically turned into a garbage bin of various functions
with very little in common.  Break it up into logical components for
isolation and manageability.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-05-25 05:43:49 -07:00
H. Peter Anvin
a87c5e4c87 Merge remote-tracking branch 'origin/nasm-2.12.xx'
Resolved Conflicts:
	.gitignore
	Makefile.in
	Mkfiles/msvc.mak
	Mkfiles/netware.mak
	Mkfiles/openwcom.mak
	Mkfiles/owlinux.mak
	preproc-nop.c
	preproc.c
	version

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-05-16 21:27:33 -07:00
H. Peter Anvin
407166001c Fix building in a separate directory from the source code
The code to handle building in a separate directory had seriously
bitrotted.  This contains a number of fixes to make it possible,
including bits like the documentation which never worked in the past.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-05-16 20:30:09 -07:00
H. Peter Anvin
b06736ae7e Unbreak building in a separate object directory
Fix bitrot in building in a separate object directory.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-05-16 13:20:01 -07:00
H. Peter Anvin
274cda81f8 Use a hash to keep exactly one copy of each filename around
The old code for keeping track of source file name and line was
confused as hell about ownership of the strings, and it is pretty
clear we leaked that information all over the place.

Instead, use a hash table to keep a copy of each string as necessary,
and simply make references to a string pool that we keep until the end
of the assembly session.

This pool probably should be unified with the list of dependency
files, and so on, but that is for the development branch.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-05-10 03:01:58 -07:00
Cyrill Gorcunov
4670887c4d out: Elf -- Merge Elf32, Elfx32 and Elf64 into single file
There is a bunch of common code here so merge them all into one file.
Unmergable parts are wrapped with is_elf() helpers.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:41 +03:00
H. Peter Anvin
89c1770e14 autoconf improvements: @SET_MAKE@, library extension
Minor autoconf corner cases.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-09 14:11:40 -08:00
H. Peter Anvin
3ef4f00d5a lib: split library into stdlib and nasmlib; header handling fixes
Split lib/ into nasmlib/ (for nasm-specific functions) and stdlib/
(for replacements for C library functions which may be missing.)

Rename the ersatz inttypes.h to nasmint.h so we can use a simple test
in compiler.h instead of dealing with include path magic.

Remove tests in configure.in for ancient missing functions (which will
break the build anyway.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 12:20:02 -08:00
H. Peter Anvin
2bc0ab38a2 Move version strings to a separate header
Move version strings to a separate header, instead of needing to
include nasm.h in places where it probably really doesn't belong.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 02:17:36 -08:00
H. Peter Anvin
cc147f79e4 Makefiles: use actual archive managers
There is no reason to not use an archive manager to build our
executables.  If there really are systems which don't have any kind of
archive manager, we can simply link all the objects.

This also drops any use of configure to detect library objects.
Instead just use HAVE_* and let the archive manager delete them.

A lot of additional functions could be declared library functions and
reorganized.

***FIX*** Mkfiles/*.mak have not yet been updated.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 02:08:44 -08:00
H. Peter Anvin
bdae10bee2 Move file I/O related functions out of nasmlib.c
nasmlib.[ch] desperately need to be broken up into smaller chunks.

Break file I/O related functions out into file.c, so at least we can
avoid the problem with P_WAIT being defined in <io.h> on Windows but
is also used as a prefix constant in "nasm.h".

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 01:22:13 -08:00
H. Peter Anvin
1917f45ec2 Merge remote-tracking branch 'origin/nasm-2.12.xx'
Resolved Conflicts:
	output/codeview.c
	output/outelf32.c
	output/outelf64.c
	output/outelfx32.c
	output/outform.c
	output/outform.h
	output/outieee.c
	output/outobj.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 01:08:53 -08:00
H. Peter Anvin
8da30d0266 Makefiles: run "make alldeps"
Automatic update of dependencies.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 23:23:19 -08:00
H. Peter Anvin
6224033738 Merge remote-tracking branch 'origin/nasm-2.12.xx'
Resolved Conflicts:
	.gitignore
	Makefile.in
	assemble.c
	configure.in
	eval.c
	float.c
	listing.c
	nasm.c
	nasmlib.c
	output/outform.h
	preproc.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 12:15:40 -08:00
H. Peter Anvin
172b840aa3 Change nasmlist/ListGen to lfmt/struct lfmt
For consistency with ofmt/dfmt, change the listing structure
to "struct lfmt" and "lfmt" and move it to listing.h.

From master branch commit 8ac25aa020

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-07 12:08:48 -08:00
H. Peter Anvin
d4c67b1597 nsis: make nsis output automatically select architecture
Make the NSIS output automatically select the output architecture to
generate the proper filename and, much more importantly, set up the
proper default install directory.

This requires Perl as well as makensis to be present in order to make
an installer, but that doesn't really seem like a too onerous of a
requirement (NSIS being the big external dependency here.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-03 21:37:37 -08:00
H. Peter Anvin
8ac25aa020 Change nasmlist/ListGen to lfmt/struct lfmt
For consistency with ofmt/dfmt, change the listing structure
to "struct lfmt" and "lfmt" and move it to listing.h.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 01:16:18 -08:00
H. Peter Anvin
15a6aa7ade Makefile: remove explicit mention of lib/strlcpy.c
Don't inclure lib/strlcpy.c unconditionally, that is what
LIBOBJS is for.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 01:07:34 -08:00
H. Peter Anvin
d338b376df Portability improvements and autoconf modernization
Improve the portability of the code and modernize our use of
autoconf.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 01:03:51 -08:00
H. Peter Anvin
99276cc7d9 outmacho: rename outmac.c to outmacho.c
We already have outmacho.mac, so name this file outmacho.c.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-12 21:19:13 -08:00
H. Peter Anvin
c635497870 Merge the macho32 and macho64 (outmac32/64) backends
Merge the two Mach-O backends for cleanliness and maintainability.
This should also make the recent fixes to MachO-64 available in
MachO-32.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-12 03:04:41 -08:00
H. Peter Anvin
ad790a2e39 make alldeps to remove unnecessary dependencies for realpath.c
The previous commit contained unnecessary dependencies for realpath.c
so run make alldeps to remove those.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-01-26 12:07:58 -08:00
H. Peter Anvin
4627e695a5 Portability improvements to nasm_realpath()
Try harder to nasm_realpath() to be as portable as possible.  Move it
to a separate file since it has gotten complex enough that it is
cleaner that way.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-01-26 12:01:34 -08:00
Jim Kukunas
3115e789d6 coff: Add support for the Codeview 8 debug format
Codeview is a debug format for win32/win64 PE/COFF files. It adds two sections,
.debug$S (symbols) and .debug$T (types), to the generated object file. These
sections are then used by the linker to generate a PDB file which can be used
by various debuggers (WinDbg, Visual Studio, etc).

Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-01-24 14:14:39 +03:00
Jim Kukunas
ba754eec03 Add a MD5 implementation
This implementation was written by Colin Plumb and
is in the public domain.

I've updated it to use stdint.h and the standard C types rather than
sys/types.h for portability.

Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-01-24 14:14:00 +03: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
cd4c89bbb9 "make alldeps"
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24 11:18:50 -08:00
H. Peter Anvin
45a22d9a61 iflag: Fix dependencies, factor out static components of iflag.h
Multi-dependencies don't work as expected, especially not across Make
versions, this is why we don't use them and read the instructions list
multiple times.

iflag.h has a lot of static content, so factor out the static content.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24 11:13:10 -08:00
H. Peter Anvin
015774dc3f "make alldeps"
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24 10:56:49 -08:00
Cyrill Gorcunov
ddf803b498 make: Update deps
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-11-24 13:21:04 +04:00
Cyrill Gorcunov
0835915c1d iflag: Start using new instruction flags engine
Here we start using instruction flags generator.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-11-24 13:20:59 +04:00
Cyrill Gorcunov
acfb97d3db make: Add 'golden' target
We've 'test' target in toplevel Makefile, lets be
complete and allow to generate "golden" tests from
toplevel as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-11-24 12:26:35 +04:00
Jin Kyu Song
5f3bfee708 disp8: Consolidate a logic to get compressed displacement
Consolidated two separate but similar functions in nasm and ndisasm
into a commonly linked source code.
To encode and decode the compressed displacement (disp8*N) for EVEX,
N value should be derived using various conditions.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-11-20 15:40:55 -08:00
Cyrill Gorcunov
32019da3a4 Revert "make: Remove generated files on clean target"
This reverts commit b6c7291b3d.

We already have this cleanup stage in "cleaner" target, I managed
to miss it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-10-28 11:35:55 +04:00
Cyrill Gorcunov
b6c7291b3d make: Remove generated files on clean target
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-10-27 21:15:47 +04:00
H. Peter Anvin
8bbf299307 Merge remote-tracking branch 'origin/master' 2013-10-24 14:17:23 +01:00
H. Peter Anvin
33eecb68c2 Makefile.in: always run "make alldeps" when "make dist"
"make dist" (tarball generation) really should include "make alldeps"
so the Makefile dependencies are correct.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-10-24 13:57:57 +01:00
H. Peter Anvin
faf04eec3c Run "make alldeps" to update dependencies 2013-10-24 13:45:06 +01:00
H. Peter Anvin
165eead3b8 Makefile.in: generate manpages for "make dist"
Make sure the "dist" target generates the man pages.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-10-24 13:25:51 +01:00
H. Peter Anvin
d089c2251b Revert "build: Include pregenerated nasm manpages"
This reverts commit 99427bdb6c.

We don't include generated files in the repository, instead we should
pregenerate them for the tarball generation, just as we do for the
Perl-generated files.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-10-24 13:22:19 +01:00
Cyrill Gorcunov
99427bdb6c build: Include pregenerated nasm manpages
It's been reported that force people to install
asciidoc for man pages generation is not acceptible.
Just ship them pregenerated.

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

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-22 10:09:35 +04:00
H. Peter Anvin
a9397830f7 Make the errors for missing man page tools comprehensible
A lot of confusion was had due to missing asciidoc...

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-05-17 12:03:24 -07:00
Cyrill Gorcunov
1930007f3f make: Don't forget to generate manpage for all target
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-18 01:31:59 +04:00
Cyrill Gorcunov
1a63699ce5 man: Generate manpages from asciidoc format
The asciidoc format is a way more easier to read
by a human.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-17 22:50:19 +04:00
Cyrill Gorcunov
b5e8fec848 preproc: Move NOP preprocessor into separate file
No need to carry it in nasm.c, let it be more modular.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-07 11:34:27 +04:00
H.J. Lu
04633d07b6 backend: add support for x32 ELF
Add an x32 ELF (32-bit code with the CPU in 64-bit mode) backend.
2012-02-03 12:08:59 -08:00
Cyrill Gorcunov
fc0c1281db preproc: Add tokenization tracing
It's a bit more than that, also TRACE=1 make
flag added to run this facility on and off
at compiling time.

Debug feature only, doesn't affect regular users.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 19:51:44 +04:00
H. Peter Anvin
1f0e0bcf1f Merge branch 'nasm-2.09.xx' 2011-06-23 13:27:43 -07:00
H. Peter Anvin
c050362865 Makefile: hopefully fix rdoff parallel build problems
The strange dependency on nasmlib.o causes serious issues in parallel
build; hopefully fix it.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-06-23 13:26:59 -07:00
Cyrill Gorcunov
4297aaf117 make: Add cscope targed
For easier use of cscope

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-02-14 21:53:15 +03:00
Cyrill Gorcunov
0d485cbdd6 make: Add tags and TAGS targets
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-05 14:18:51 +03:00
Cyrill Gorcunov
81d53791b0 make: Add "test" target into .PHONY
Michael proposed to run

 | sed -i -e '/^.PHONY: all/s/$/ test/' Makefile.in

since we have test/ directory. Good idea.

Reported-by: Michael Sterrett
Patch-by: Michael Sterrett
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-10-29 00:40:16 +04:00
H. Peter Anvin
5e2e8b9105 Rename filenames to 8.3 format
Apparently some people still care about compiling native on MS-DOS,
and we don't have a significant number of files which need adjustment.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-06-15 10:47:16 -07:00
H. Peter Anvin
084b13227e Add generic ilog2 functions
Add ilog2_{32,64}() and alignlog2_{32,64}() ... the latter is intended
for alignment statements and return -1 for non-power-of-2 other than 0
(which returns 0).

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-04-21 16:43:20 -07:00
H. Peter Anvin
34543131ca Makefile: clean up the lib directory on make clean
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-04-21 16:41:37 -07:00
Cyrill Gorcunov
4c8e74e176 make: Update pecoff.h related deps
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-21 18:51:14 +04:00
Cyrill Gorcunov
126faf2e3b output/outelfX.c: Use definitions from stabs.h
Also made Makefile.in to handle dependency.
There are some makefiles in Mkfiles\ should
be fixed as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-01-03 15:04:36 +03:00
H. Peter Anvin
6650557a35 Run "make alldeps" 2009-11-30 13:28:31 -08:00
Cyrill Gorcunov
a50f829435 Merge elf header files
Merge elfcommon.h, elf32.h, elf64.h into
single elf.h -- we do support both elf32
and elf64 anyway. Let put them into common
place.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-11-06 22:00:41 +03:00
H. Peter Anvin
eaa68f1c85 Add strlcpy() function
Add strlcpy() function and implementation, and use configure to detect
if strlcpy() is natively available on the system.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-08-10 15:59:34 -07:00
H. Peter Anvin
ab6443969a Run make alldeps 2009-07-18 18:43:28 -07:00
H. Peter Anvin
afa06137fa Hash even backend-specific directives, unify null functions
Hash all directives, even the ones that are backend-specific,
and instead pass the backend an already-parsed directive number.

Furthermore, unify null functions across various backends.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-12 12:55:24 -07:00
H. Peter Anvin
323fcff32b Use a phash to decode directives
We can use a perfect hash to decode directives as well.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-12 12:04:56 -07:00
Keith Kanios
6d0d0d2736 macho64: Manually merge macho64 branch with master branch. 2009-07-08 23:04:52 -05:00
H. Peter Anvin
dcd6c5d877 Run make alldeps 2009-06-27 22:16:33 -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
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
d8979222e9 nasm.nsi: add NASM Manual; automate version generation
Add the NASM Manual (as a PDF) to the Windows installer, and abstract
out the version number.
2009-04-06 19:12:34 -07:00
H. Peter Anvin
1fee7d2d23 ELF: use rbtree for symbol searches
Linear searches are evil, so use an llrbtree to search for symbols by
offset.  This doesn't change the preexisting behaviour that we only
look for global symbols.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-06 19:55:05 -08:00
H. Peter Anvin
4b9358928b Move all version strings to a single compilation unit (ver.c)
Move all the version strings to a single compilation unit, ver.c; this
does not include the version macros, which are fed into macros.c.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-31 16:53:49 -07:00
H. Peter Anvin
e8873121aa rbtree: drop the data pointer; instead rely on being embedded
Drop the data pointer, and instead assume the struct rbtree will be
embedded in a bigger data structure (to be extracted via
container_of()).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-30 10:58:28 -07:00
H. Peter Anvin
3e364fe274 Left-leaning red-black tree data structure
Implement library functions for "left-leaning red-black trees" with
uint64_t keys.  This is meant for looking up symbols by address in the
backends that need to do so, e.g. ELF.

A good question is if there is a better way to do this, that recovers
the original symbol, but that's a future issue.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 23:31:56 -07:00
H. Peter Anvin
5da04b035c make alldeps
Run "make alldeps"

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 21:03:17 -07:00
H. Peter Anvin
03c4f90afa output: add common file outlib.c for common functions; realsize()
Add a common file, outlib.c, for output formats.  Add the function
realsize() instead of open-coded variants in almost every backend.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-27 22:19:59 -07:00
H. Peter Anvin
325a4bff50 Run "make alldeps" 2008-09-09 09:54:47 -07:00
Victor van den Elzen
1b1522fadf Add a 'make test' target. 2008-07-16 12:20:22 +02:00
H. Peter Anvin
cdc69da37c version.mak for the version Makefile fragment
Be consistent about the naming of the version Makefile fragment.  We
use .mak elsewhere for Makefiles, so use that.
2008-07-13 13:54:47 -07:00
H. Peter Anvin
386866a345 Add version.make to PERLREQ
version.make is produced by a Perl script, and therefore should be in
PERLREQ.
2008-07-05 17:45:01 -07:00
H. Peter Anvin
7b5aad8498 Run "make alldeps" 2008-06-21 18:19:13 -07:00
H. Peter Anvin
cfb7176ca2 Move the output format macros into the macros.pl mechanism
Move the handling of "extra" macros (i.e. output format macros) into
the macros.pl mechanism.  This allows us to change the format of the
internal macro store in the future - e.g. to a single byte store
without redundant pointers.

Also, stop using indicies into a long array when there is no good
reason to not just use different arrays.
2008-06-20 15:20:16 -07:00
H. Peter Anvin
72edbb87ef macros.c: compress by tokenizing macro directives
Compress macros.c by representing macro directives with a single byte.
We can do this because we only use the ASCII character range inside
the standard macro files.

Note: we could save significant additional space by not having a
pointer array, and instead relying on the fact that we sweep
sequentially through the output array.
2008-06-19 16:00:04 -07:00
H. Peter Anvin
d2456590fc preproc: add support for builtin include modules (%use)
Add a builtin equivalent to the %include directive called %use.
%use includes a standard macro file compiled into the binary; these
come from the macros/ directory in the source code.

The idea here is to be able to provide optional macro packages with
the distribution, without adding complex host filesystem dependencies.
2008-06-19 15:04:18 -07:00
H. Peter Anvin
c0d6066d99 syncfiles: use #-- ... --# for consistency with mkdep.pl
mkdep.pl already used #-- ... --# (two dashes) whereas syncfiles.pl
was using #--- ... ---# (three dashes).  Change syncfiles.pl to match
mkdep.pl.
2008-06-15 23:50:50 -07:00
H. Peter Anvin
7806e96508 Script to automagically synchronize the object file lists
Add a script to automagically synchronize the list of object files
between the various Makefiles.
2008-06-15 16:54:29 -07:00
H. Peter Anvin
518df30308 Implement __utf16__() and __utf32__() for the DB family
Implement __utf16__() and __utf32__() for the DB family of
pseudo-instructions.  Not yet implemented for evaluation context.
2008-06-14 16:53:48 -07:00
H. Peter Anvin
fcb8909749 Move all the RAA code out of nasmlib
The RAA code doesn't have to be in nasmlib; it is only used by nasm
itself, and is better handled in a separate module.
2008-06-09 17:40:16 -07:00
H. Peter Anvin
1803dedae8 Move all the SAA code out of nasmlib
Move all the SAA code out of nasmlib; it's not used by anything than
nasm itself.  Cleaning out the kitchen sink known as nasmlib is a good
thing, too.
2008-06-09 17:32:43 -07:00
H. Peter Anvin
c735d1a6b2 Replace the WSAA macros with functions
Change the WSAA macros into functions; reducing the icache footprint.
2008-06-08 21:15:01 -07:00