Commit graph

223 commits

Author SHA1 Message Date
H. Peter Anvin
90cc4154ae BR 3392397: WMAKE uses a nonstandard syntax for phony targets
The standard syntax for a phony target in Make is:

target: <dependencies>

.PHONY: target

... however, Watcom WMAKE seems to use

target: <dependencies> .SYMBOLIC

and furthermore, seems to *require* it.  Therefore, remove the
"perlreq" target from the automatically distributed region and move it
into the specific region; it should not need to change anyway since
the PERLREQ list itself is still synced.

If it was only a matter of the .SYMBOLIC versus .PHONY token it would
be easy enough to change that in syncfiles.pl, but this syntax change
is big enough that it doesn't make enough sense to worry about.

Reported-by: sezero <sezero@users.sourceforge.net>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-05 21:24:55 -07:00
H. Peter Anvin
675e7b7d79 MSVC compatibility: clean up the handling of _stati64/_fstati64
On Windows we need to use _stati64/_fstati64 in order to handle large
file sizes, but the handling was broken in the canned MSVC++
configuration.  Clean it up and fix it.

This addresses BR 3392398.

Reported-by: Nikolai Saoukh <nms@otdel-1.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-05 21:19:03 -07:00
Nikolai Saoukh
9546507861 BR 3392395: unbreak msvc.mak build due to a stray backslash
Extra backslash had eaten one innocent line, thus compiler flags
(ALL_CFLAGS) are gone.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-05 20:58:42 -07:00
H. Peter Anvin
6c48b42466 Mkfiles: harmonize how perl and (if available) makensis is run
Use the same macros to run Perl and makensis across all Makefiles.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-03 11:23:31 -07:00
H. Peter Anvin
14858d7343 Makefiles: distribute file generation rules via syncfiles.pl
Distribute the file generation rules to auxiliary Makefiles via
syncfiles.pl.  These rules are OS- and Make-dialect-generic enough
that our mangling script handles them well enough.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-03 11:13:29 -07:00
H. Peter Anvin
1ebc83bd41 Mkfiles: remove unsupported Mkfiles/netware.mak
If someone really, really care about building NASM for Netware(!)
anymore, then they probably can use the autoconf-driven build script.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-03 11:12:20 -07:00
H. Peter Anvin
526a6c7390 Rename insns-iflags.pl -> insns-iflags.ph, add missing dependency
insns-iflags.ph is included from another Perl script, so rename it .ph
(Perl header).  Add missing dependency to the main Makefile.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-03 10:33:12 -07:00
H. Peter Anvin
5253f58c36 Add generic perfect string hashes, use for directives
Add a generic facility for generating perfect string hashes, where all
that is needed is an enum and a string table.  The existing mechanism
using a custom Perl script wrapped around a module continues to be
available for any use case where this particular approach isn't
sophisticated enough.

Much of this patch comes from renaming "enum directives" to "enum
directive" as a result of the string hash generator expecting a set of
uniform naming conventions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-03 00:27:07 -07:00
sezero
2cd8bab66a Mkfiles: remove useless/broken owlinux.mak, update README for openwcom.mak
To build with OpenWatcom and a standard Unix/GNU Make, use the owcc
wrapper.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-03-31 14:01:26 -07:00
H. Peter Anvin
ea33e83081 Run "make alldeps"
Missing dependencies strike again :(

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-03-08 01:31:10 -08:00
H. Peter Anvin
a6e26d9cca Add a generic pragma-handling infrastructure
Add infrastructure for handling %pragmas with a variety of namespaces,
etc., etc...

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-03-07 21:32:37 -08:00
H. Peter Anvin
b20bc733c9 asm/*: Move directive processing to its own file, refactor error handling
Move directive processing to its own file, and move nasmlib/error.c to
asm/error.c (it was not used by the disassembler); remove some extern
declarations from .c files, and do some general code cleanups.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-03-07 19:31:04 -08:00
H. Peter Anvin
ed40e2528d Rename directiv.c to directbl.c to free up the name directiv.c
We want to move the directive handling to a separate file, so change
the filename of the directive table handler to something a bit more
specific.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-03-07 18:08:03 -08:00
H. Peter Anvin
6980985eb9 make clean: clean up more things that ought to be
Cleaning up hasn't really kept up to date with source code changes.
Try make it better for now; this also ought to make it easier to do
the corresponding cleaning in the *.mak files.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-03-01 01:23:00 -08:00
sezeroz
34b5dbe496 openwcom.mak: further fixes to build with OpenWatcom WMAKE
Further fixes for OpenWatcom/WMAKE (BR 3392383).

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-02-28 23:01:14 -08:00
H. Peter Anvin
2d6a3101f9 Run make alldeps 2017-02-28 18:14:35 -08:00
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
sezeroz
c585e8b654 openwcom.mak: BR 3392381: update to work for the current master
Update openwcom.mak to work on the current master branch, per
BR 3992381.

https://bugzilla.nasm.us/show_bug.cgi?id=3392381

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-02-28 17:38:01 -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
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
397c169736 Move config.h to a subdirectory, add MSVC-specific config file
Instead of trying to do hacks in the Makefiles, define header files
for specific compilers if they can't use autoconf.  Currently defined
for Microsoft Visual Studio, based on MSDN documentation.  It is
currently untested.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-10-04 17:01:59 -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
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
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
6a83cb93b3 msvc.mak: change $(L) to $(A)
Change $(L) to $(A) for consistency with Makefile.in.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-04-21 18:10:10 -07:00
Knut St. Osmundsen
6fd298418b msvc.mak: Build fixes, updates and improvements.
* Added missing rules for creating a library out of LIBOBJ
   and using it when linking.
 * Updated the clean rule and PRELREQ list.
 * Always build with debug info as it ends up in external PDB files
   anyway and doesn't really impact binary size.
 * Added /RELEASE to the LDFLAGS so the linker checksums the headers and
   the binary can be signed.

Signed-off-by: Knut St. Osmundsen<bird-nasm@anduin.net>
Reviewed-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-21 09:13:32 +03: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
4bef68a84e msvc.mak: /Ox and /Oy are redundant with /O2
Per the MSVC++ docs, /Ox and /Oy are redundant with /O2, and the docs
recommend that they do not be used together.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 00:50:13 -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
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
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
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
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
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
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
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
H. Peter Anvin
faf04eec3c Run "make alldeps" to update dependencies 2013-10-24 13:45:06 +01:00
Marat Dukhan
1052394ef6 make: Fix nasm build with MSVC
http://bugzilla.nasm.us/show_bug.cgi?id=3392258

Signed-off-by: Marat Dukhan <maratek@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-06-30 01:31:15 +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
Jiri Malak
a2c7855577 BR3411280: Fix incorrect compiler option for OS/2 target in Open Watcom makefile
For OS2 target the -bt option should be set accordingly.

Signed-off-by: Jiri Malak <malak.jiri@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-09-20 21:37:06 +04:00
Jiri Malak
f2536e10a0 openwcom.mak: Update to use features from newer WMAKE
Change the OpenWatcom WMAKE Makefile to use the facilities available
in WMAKE to support cross-compilation properly.

See BR 3079573.
2011-03-15 15:40:53 -07:00
Anthony Williams
6fc53d3752 make: Lift up openwcom.mak for build on FreeDOS
Signed-off-by: Anthony Williams <rugxulo@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-23 18:37:17 +03:00
H. Peter Anvin
d68d9181df openwcom.mak: drop /f from delete commands
Classic DOS doesn't have del /f, and we don't really need it.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-06-15 10:49:09 -07: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
48a434e1a9 Mkfiles: Add depends on stabs.h for Elf output
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-01-03 16:19:43 +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
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
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
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
7b5aad8498 Run "make alldeps" 2008-06-21 18:19:13 -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
19b741835f syncfiles: handle the case of the null path separator
Correctly handle the null path separator (meaning remove the directory
portion entirely.)
2008-06-15 18:33:03 -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
eb96812e9f Update Mkfiles/*.mak
Sync the file list in Mkfiles/*.mak
2008-06-15 16:18:43 -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
H. Peter Anvin
0eebf799db Update .gitignore, remove bogus dependency 2008-06-04 08:58:53 -07:00
H. Peter Anvin
3bc3c934d9 Makefile/dependency updates
Add quote.c to all the auxiliary Makefiles, and run "make alldeps".
2008-06-04 08:49:10 -07:00
H. Peter Anvin
ad42e0d1fb make alldeps 2008-05-27 14:34:53 -07:00