aboutsummaryrefslogtreecommitdiffstats
path: root/rdoff
Commit message (Collapse)AuthorAgeFilesLines
* error: replace nasm_verror() indirection with preproc callbackH. Peter Anvin2019-08-281-8/+9
| | | | | | | | | | Since pp_error_list_macros() was introduced, the only need for pp_verror() is to suppress error messages in certain contexts. Replace this function with a preprocessor callback, preproc->pp_suppress_error(), so we can drop the nasm_verror() function pointer entirely. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* errors: be more robust in handling unexpected fatal errorsH. Peter Anvin2019-08-281-2/+8
| | | | | | | | | | | | | Introduce a new error level, ERR_CRITICAL, beyond which we will minimize the amount of code that will be executed before we die; in particular don't execute any memory allocations, and if we somehow end up recursing, abort() immediately. Basically, "less than panic, more than fatal." At this point this level is used by nasm_alloc_failed(). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Move <string.h> inclusion to compiler.hH. Peter Anvin2018-12-269-9/+0
| | | | | | | There is absolutely no reason not to include <string.h> globally, and with the inline function for mempcpy() we need it there anyway. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* errors: change the severity parameter from "int" to "errflags"H. Peter Anvin (Intel)2018-12-131-1/+1
| | | | | | | Change the severity parameter to the error function from "int" to an unsigned typedef, currently uint32_t. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* Merge remote-tracking branch 'origin/nasm-2.14.xx'H. Peter Anvin (Intel)2018-12-131-3/+0
|\ | | | | | | | | | | | | | | | | | | | | Resolved Conflicts: Makefile.in Mkfiles/msvc.mak Mkfiles/openwcom.mak asm/nasm.c nasmlib/alloc.c Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
| * malloc: handle potential infinite loop in nasm_alloc_failed()H. Peter Anvin (Intel)2018-12-131-3/+0
| | | | | | | | | | | | | | | | | | It is possible on memory exhaustion that nasm_fatal() might cause another allocation error, thus calling nasm_alloc_failed() again. If we find us in nasm_alloc_failed() for a second time, try to get a message out and then call abort(). Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* | errors: simplify nasm_fatal() and nasm_panic()H. Peter Anvin2018-06-151-1/+1
|/ | | | | | | | | | | | | | | Nearly all instances of nasm_fatal() and nasm_panic() take a flags argument of zero. Simplify the code by making nasm_fatal and nasm_panic default to no flags, and add an alternate version if flags really are desired. This also means that every call site doesn't have to initialize a zero argument. Furthermore, ERR_NOFILE is now often not necessary, as the error code will no longer cause a null reference if there is no current file. Therefore, we can remove many instances of ERR_NOFILE which only deprives the user of information. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Fix implicit fallthrough that trips -WerrorH. Peter Anvin2018-05-081-0/+3
| | | | | | | -Werror now trips on implicit fallthroughs. There is also at least one that probably should not be, although it appears to be harmless. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Revert "Use fallthrough() to placate compiler"Cyrill Gorcunov2018-02-251-2/+0
| | | | This reverts commit 8a7c6009fbddd7084fdfaebd9e3e3fd0baa39bc2.
* Use fallthrough() to placate compilerCyrill Gorcunov2018-02-251-0/+2
| | | | | | | https://bugzilla.nasm.us/show_bug.cgi?id=3392465 Reported-by: Ozkan Sezer <sezeroz@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* rdoff.c: one more unsafe use of fread()H. Peter Anvin2017-04-171-1/+5
| | | | | | Use the same error pattern as the rest of the calls in this function. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* rdflib.c: fix(?) one more unsafe use of fread()H. Peter Anvin2017-04-171-1/+3
| | | | | | | 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>
* rdoff: add back rdfutils.h missing from previous checkinH. Peter Anvin2017-04-171-0/+165
| | | | | | | Checkin 8dc965347ddf9caabacc4ca0441efe3a4ec32af8 was missing this file, causing obvious failures. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* rdoff: use nasm-provided safe memory allocation and I/OH. Peter Anvin2017-04-1719-476/+185
| | | | | | | | | 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>
* rdoff: move rdoff build into main Makefile to make it build on WindowsH. Peter Anvin2017-04-061-119/+0
| | | | | | | NSIS packages rdoff, and we really want to be able to build the full NSIS package on an MSVC platform. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Makefiles: distribute file generation rules via syncfiles.plH. Peter Anvin2017-04-031-12/+13
| | | | | | | | 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>
* rdoff: check return value of freopenMartin Lindhe2017-01-051-1/+5
| | | | | | | | 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>
* rdoff/rdlar.h: include "compiler.h" not "config.h"H. Peter Anvin2016-10-061-4/+1
| | | | | | We should not include config.h "naked"; include "compiler.h". Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Merge remote-tracking branch 'origin/nasm-2.12.xx'H. Peter Anvin2016-10-041-1/+3
|\
| * ldrdf: Remove output file if there are any errorsDaniel Lundqvist2016-10-041-1/+3
| | | | | | | | | | | | | | | | 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>
* | Merge branch 'nasm-2.12.xx'Cyrill Gorcunov2016-07-271-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * nasm-2.12.xx: codeview: Fix ill-formed "S_COMPILE2" record. rdoff: Add rdf2bin input dependency labels: Warn if new label created on pass two Add explicit void parameter to newmembuf() function declaration. compiler.h: always undefine __STRICT_ANSI__ for gcc | Conflicts: | rdoff/Makefile.in Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| * rdoff: Add rdf2bin input dependencyFabian Giesen2016-07-271-4/+4
| | | | | | | | | | | | | | | | | | | | 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>
| * Add explicit void parameter to newmembuf() function declaration.bcallah@devio.us2016-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | rdoff: Add rdf2bin input dependencyFabian Giesen2016-07-181-4/+4
| | | | | | | | | | | | | | | | 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>
* | Reorganize the source code into subdirectoriesH. Peter Anvin2016-05-252-298/+7
| | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/nasm-2.12.xx'H. Peter Anvin2016-05-161-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Unbreak building in a separate object directoryH. Peter Anvin2016-05-161-1/+1
| | | | | | | | | | | | Fix bitrot in building in a separate object directory. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | autoconf improvements: @SET_MAKE@, library extensionH. Peter Anvin2016-03-091-1/+1
| | | | | | | | | | | | Minor autoconf corner cases. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | lib: split library into stdlib and nasmlib; header handling fixesH. Peter Anvin2016-03-088-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Makefiles: use actual archive managersH. Peter Anvin2016-03-081-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Move file I/O related functions out of nasmlib.cH. Peter Anvin2016-03-081-1/+1
|/ | | | | | | | | | 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>
* rdflib: actually get the timemachomergeH. Peter Anvin2016-02-121-1/+2
| | | | | | sizeof(t = time(NULL)) doesn't ever actually call time(). Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* rdoff/ldrdf.c: Add option to specify target RDF module name in command lineYuri Zaporozhets2015-01-201-9/+51
| | | | | | | | | | 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>
* Correct name spelling and email addressYuri Zaporozhets2015-01-182-15/+15
| | | | Signed-off-by: Yuri Zaporozhets <r_tty@yahoo.co.uk>
* rdoff: increase EXIM_LABEL_MAX to 256 bytesYuri Zaporozhets2015-01-111-1/+1
| | | | | | | | | 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>
* rdoff/rdlib.c: Remove unused function rdl_close()H. Peter Anvin2015-01-051-7/+0
| | | | | | The function rdl_close() is never used, remove it. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Add missing static declarations in rdoff/segtab.cH. Peter Anvin2014-11-251-3/+3
| | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add missing static declarations in rdoff/rdoff.cH. Peter Anvin2014-11-251-6/+6
| | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add missing static declaration in rdoff/rdlib.cH. Peter Anvin2014-11-251-2/+2
| | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add missing static declarations in rdoff/rdflib.cH. Peter Anvin2014-11-251-2/+2
| | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add missing static declaration in rdoff/rdfdump.cH. Peter Anvin2014-11-251-2/+2
| | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add missing static declarations in rdoff/ldrdf.cH. Peter Anvin2014-11-251-8/+8
| | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* rdoff: don't check fwritezero() return value.Jim Kukunas2014-11-101-2/+1
| | | | | | | Since e76a6260556d76b756ef56cdd4ca5b41e61259bc, the return type of fwritezero() is void. Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
* Fixed two more resource leaks in rdoff/rdlib.cPhilipp Kloke2013-04-011-0/+2
| | | | | Signed-off-by: Philipp Kloke <philipp.kloke@web.de> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Fixed three possible buffer overflowsPhilipp Kloke2013-04-011-3/+3
| | | | | | | 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>
* Fixed several resource and memory leaksPhilipp Kloke2013-04-013-1/+5
| | | | | | | 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>
* rdoff: add missing dependency in MakefileH. Peter Anvin2011-06-231-1/+1
| | | | | | | Add back a dependency which was accidentally dropped for the previous build bug fix. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Makefile: hopefully fix rdoff parallel build problemsH. Peter Anvin2011-06-231-11/+9
| | | | | | | 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>
* Use fputs instead of fprintf for plain stringsVictor van den Elzen2009-08-131-1/+1
| | | | LLVM's Clang warns about this. outieee.c had a real problem.
* NASM: relicense under the 2-clause BSD licenseH. Peter Anvin2009-07-061-4/+1
| | | | | | | | *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>