It isn't 100% clear what is the right thing to do in this particular
case, so this is my best attempt...
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
We already have abort-on-error memory allocation and I/O operations in
nasmlib, so use them for rdoff as well.
Delete long-since-obsolete rdoff Mkfiles directory.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
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>
fixes pvs-studio error 'V530 The return value of function 'freopen'
is required to be utilized.'
Signed-off-by: Martin Lindhe <martin-commit@ubique.se>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
If there are any errors while linking, we should not create an
output file.
Signed-off-by: Daniel Lundqvist <daniel@malarhojden.nu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
On host platforms where $(LN_S) is cp, need to make sure to
link rdf2bin first.
Backport of 6d67dbfa95
Signed-off-by: Fabian Giesen <fabiang@radgametools.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
On host platforms where $(LN_S) is cp, need to make sure to
link rdf2bin first.
Signed-off-by: Fabian Giesen <fabiang@radgametools.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
In rdoff/rdoff.c, the function declaration for newmembuf is written:
static memorybuf *newmembuf()
The attached diff adds an explicit void parameter.
It seems like it would be nicer with an explicit void parameter
especially since the -Werror build options seem to want to find such
things.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
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>
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>
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>
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>
Rationale: this is useful for projects developed entirely in high-level
language and which use NASM as a backend (compilers able to generate NASM
code are e.g. ncc or Free Pascal). With this option there is no need to have
a single assembly language file for each project with just one "module NNN"
directive — it is enough now to specify the name as an argument to ldrdf.
Signed-off-by: Yuri Zaporozhets <r_tty@yahoo.co.uk>
Rationale: this is required for, e.g., FreePascal, which tends to generate
very long labels for procedures/methods that do not fit into 64 bytes.
This change does not introduce any incompatibilities.
Signed-off-by: Yuri Zaporozhets <r_tty@yahoo.co.uk>
*To the best of my knowledge*, we now have authorization from everyone
who has significantly contributed to NASM in the past. As such,
change the license to the 2-clause BSD license.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Consider that argv[0] may contain extensions like .exe as well as
pathname prefixes. Handle it by searching backwards for the string
"rdf2" and then extract the alphanumeric tail that follows.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The more common acronym for Intel Hex seems to be "ith", but the
legacy utility was "rdf2ihx", so we allow both variants. However, the
Makefile rule was wrong.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Make the base addresses in rdfload unsigned. Note: this file is
really obsolete; it can't represent RDF2 with more than the 3
old-style segments.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Remove rdf2ihx.c since I think it's unlikely we'll ever get it
relicensed -- any attempts at contacting the author has failed, and
it's easier to reconstruct it from scratch.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>