Commit Graph

99 Commits

Author SHA1 Message Date
bcallah@devio.us
065c34273c Add explicit void parameter to newmembuf() function declaration.
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>
2016-07-14 14:15:41 -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
2bc798a968 rdflib: actually get the time
sizeof(t = time(NULL)) doesn't ever actually call time().

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-12 21:21:57 -08:00
Yuri Zaporozhets
d9ca54b6d2 rdoff/ldrdf.c: Add option to specify target RDF module name in command line
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>
2015-01-20 23:38:52 +02:00
Yuri Zaporozhets
7a33af2904 Correct name spelling and email address
Signed-off-by: Yuri Zaporozhets <r_tty@yahoo.co.uk>
2015-01-18 20:21:14 +02:00
Yuri Zaporozhets
76ee8e6091 rdoff: increase EXIM_LABEL_MAX to 256 bytes
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>
2015-01-11 21:16:34 +02:00
H. Peter Anvin
12c0702824 rdoff/rdlib.c: Remove unused function rdl_close()
The function rdl_close() is never used, remove it.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2015-01-05 15:21:43 -08:00
H. Peter Anvin
ad2acd7754 Add missing static declarations in rdoff/segtab.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:35:29 -08:00
H. Peter Anvin
31bcb6f866 Add missing static declarations in rdoff/rdoff.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:35:16 -08:00
H. Peter Anvin
b06da211f4 Add missing static declaration in rdoff/rdlib.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:34:34 -08:00
H. Peter Anvin
48166388d5 Add missing static declarations in rdoff/rdflib.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:34:03 -08:00
H. Peter Anvin
ef18237372 Add missing static declaration in rdoff/rdfdump.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:33:33 -08:00
H. Peter Anvin
c9f0447079 Add missing static declarations in rdoff/ldrdf.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-11-25 12:14:52 -08:00
Jim Kukunas
e184c0b0cb rdoff: don't check fwritezero() return value.
Since e76a626055, the return type of fwritezero()
is void.

Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
2014-11-10 11:45:10 -08:00
Philipp Kloke
c7b53ffe1f Fixed two more resource leaks in rdoff/rdlib.c
Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-04-01 02:17:46 +04:00
Philipp Kloke
efe66c65d1 Fixed three possible buffer overflows
Bug found by: CppCheck 1.59 (static source analysis tool)

Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-04-01 02:16:58 +04:00
Philipp Kloke
dae212d049 Fixed several resource and memory leaks
Bug found by: CppCheck 1.59 (static source analysis tool)

Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-04-01 02:16:27 +04:00
H. Peter Anvin
bf5652d220 rdoff: add missing dependency in Makefile
Add back a dependency which was accidentally dropped for the previous
build bug fix.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-06-23 13:40:06 -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
Victor van den Elzen
0dd450c0ef Use fputs instead of fprintf for plain strings
LLVM's Clang warns about this. outieee.c had a real problem.
2009-08-13 15:07:59 +02:00
H. Peter Anvin
8ee2e244eb NASM: relicense under the 2-clause BSD license
*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>
2009-07-06 11:09:11 -07:00
H. Peter Anvin
7ae512b5a8 More "make install" fixes... 2009-07-05 18:48:50 -07:00
H. Peter Anvin
2fa822b3b3 rdf2bin: be smarter about extracting the format from argv[0]
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>
2009-07-05 18:31:33 -07:00
H. Peter Anvin
662b3fe3a4 rdoff: fix "make install"
Fix "make install" for the new rdf2bin aliases.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05 17:08:46 -07:00
H. Peter Anvin
7f2c476297 rdf2bin.1: add missing space
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-03 22:36:03 -07:00
H. Peter Anvin
06c05ae72a rdoff/test/Makefile: actually do build tests
Add actual Makefile rules for the rdoff tests.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-03 21:19:37 -07:00
H. Peter Anvin
a0374589aa rdf2bin: update man page, add link pages for aliases
Update the rdf2bin man page; add link man pages for the various
command aliases.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-03 21:11:21 -07:00
H. Peter Anvin
c1f13fc80f Correct the legacy name rdf2ihx (as opposed to rdf2ith)
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>
2009-07-03 21:02:33 -07:00
H. Peter Anvin
1e5b102109 rdf2bin: revamp so it can output bin, ith, or srec
Revamp rdf2bin so it can output binary, Intel hex, or Motorola
S-records.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-03 15:30:48 -07:00
H. Peter Anvin
099f05dce4 rdfload: make the base addresses unsigned
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>
2009-07-03 15:28:45 -07:00
H. Peter Anvin
6c98ca4ddc Remove rdf2ihx.c, since it looks unlikely we'll get it relicensed.
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>
2009-07-03 13:40:57 -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
999868f06f Unify all-zero buffers; add fwritezero()
We have a number of all-zero buffers in the code.  Put a single
all-zero buffer in nasmlib.c.  Additionally, add fwritezero()
which can be used to write an arbitrary number of all-zero bytes;
this prevents the situation where the all-zero buffer is simply
too small.
2009-02-21 17:24:08 -08:00
H. Peter Anvin
9726b1e971 rdx: Add cast avoid warning from gcc
Avoid a warning from gcc about casting an integer of different size to
a pointer.
2008-05-20 14:25:36 -07:00
Bo Borgerson
7d4d2c3cc9 Avoid some warnings in rdoff/rdf2bin.c
I received some warnings when running make on the head revision of
nasm from git:

----
rdf2bin.c: In function 'main':
rdf2bin.c:122: warning: comparison between signed and unsigned
rdf2bin.c:123: warning: comparison between signed and unsigned
rdf2bin.c:124: warning: comparison between signed and unsigned
----

I think these warnings are innocuous and should be safely avoidable
with simple casts (please see attached patch).

* rdoff/rdf2bin.c
(main): cast to size_t for comparison with fwrite return value

Signed-off-by: Bo Borgerson <gigabo@gmail.com>
2008-04-12 11:12:14 -07:00
Charles Crayne
b8b1a61d10 Define MKDIR for rdoff make file
Addition of rdoff man pages uses MKDIR, which was not defined
2007-12-30 14:24:10 -08:00
Beroset
095e6a2973 regularized spelling of license to match name of LICENSE file 2007-12-29 09:44:23 -05:00
H. Peter Anvin
c79262a61e rdoff: add man pages from the Debian project.
Add man pages for some of the rdoff programs, from the Debian project.
2007-12-18 16:12:13 -08:00
H. Peter Anvin
682221438e Clean up remaining build warnings
Clean up remaining build warnings.  None of this should affect code
operations.  The only warnings which were actually relevant might have
been the ones in ldrdf.c, but it's not clear if anyone ever uses that.
2007-11-18 22:18:09 -08:00
H. Peter Anvin
d0378fb1ed BR 1834056: Remove warnings in rdoff/rdoff.c
Remove warnings, especially the alias warnings in rdoff/rdoff.c.
2007-11-18 12:01:05 -08:00
H. Peter Anvin
ff9e7e34a1 Actually shut up the warning in rdfload.c
Shut the warning in rdfload.c up properly...
2007-10-28 23:10:34 -07:00
H. Peter Anvin
577f247be4 Fix warning about cast to pointer in rdfload.c
Fix warning in rdfload.c about cast to pointer of different size when
compiling on 64 bits.  Of course, rdfload is probably useless on 64
bits, but it's pretty useless in the first place.
2007-10-28 22:04:00 -07:00
H. Peter Anvin
7065309739 Formatting: kill off "stealth whitespace"
"Stealth whitespace" makes it harder to read diffs, and just generally
cause unwanted weirdness.  Do a source-wide pass to get rid of it.
2007-10-19 14:42:29 -07:00
Charles Crayne
f3eea3d539 Suppress datarootdir warnings from configure 2007-10-18 23:33:06 -07:00
H. Peter Anvin
684f98b636 Fix invocation of readnum()
readnum() takes a boolean for error.
2007-10-18 19:14:07 -07:00
H. Peter Anvin
6867acc18e Use the compiler-provided booleans if available, otherwise emulate
Both C and C++ have "bool", "true" and "false" in lower case; C
requires <stdbool.h> for this, in C++ it is an inherent type built
into the compiler.  Use those instead of the old macros; emulate with
a simple typedef enum if unavailable.
2007-10-10 14:58:45 -07:00
H. Peter Anvin
fe501957c0 Portability fixes
Concentrate compiler dependencies to compiler.h; make sure compiler.h
is included first in every .c file (since some prototypes may depend
on the presence of feature request macros.)

Actually use the conditional inclusion of various functions (totally
broken in previous releases.)
2007-10-02 21:53:51 -07:00
H. Peter Anvin
d105682096 Remove $Id$ tags (useless with git)
Remove CVS $Id$ tags, since git doesn't use them.
2007-09-12 21:05:06 -07:00
Frank Kotler
2ad45a56b4 remove "#include <unistd.h> from rdoff directory - two places - it annoyed Windows users and seems unneeded 2007-08-26 05:41:33 +00:00
H. Peter Anvin
3b69717a12 ldrdf: cast output of sizeof() before passing to printf(), to avoid warning.
The C99 way of doing this would be to use %zu, but that requires intrinsic
C library support.
2007-08-20 20:02:17 +00:00