Peter Johnson [Sun, 8 Jun 2003 22:58:21 +0000 (22:58 -0000)]
Display fatal errors as FATAL, and perform other error display cleanups.
Exit immediately after bad arch/objfmt/etc selections to avoid "bad option"
secondary errors.
Peter Johnson [Sun, 8 Jun 2003 21:21:22 +0000 (21:21 -0000)]
Make yasm_fatal() and implementations take a list of printf-like parameters.
Also, don't abort(), just exit()... unlike internal errors, which we want a
backtrace for, fatal errors may happen during normal operation.
Peter Johnson [Sun, 8 Jun 2003 20:17:21 +0000 (20:17 -0000)]
Simplify preloaded search case by removing any library extension in
list_modules() rather than trying to figure it out in list_module_load().
Also avoids the corner failure case when archives aren't named *.a.
Peter Johnson [Sat, 7 Jun 2003 21:56:47 +0000 (21:56 -0000)]
Change module loader interface a bit (use enum instead of string to specify
module type), and make "yasm -[adfpr] help" work dynamically by scanning
preloaded symbols and filesystem directories.
Peter Johnson [Sat, 31 May 2003 22:37:58 +0000 (22:37 -0000)]
Add an architecture to support the LC-3b ISA as used in the ECE 312 course
at the University of Illinois, Urbana-Champaign.
See http://courses.ece.uiuc.edu/ece312/ for more details.
Peter Johnson [Tue, 27 May 2003 04:13:16 +0000 (04:13 -0000)]
Add support for FAR call/jmp. Because of the jmp label, label equ seg:off
problem, adding this required adding some fields to x86_jmprel (now a
misnomer, as FAR jumps are absolute) to save the far opcode, and additional
support in libyasm's yasm_expr_* to properly handle the YASM_EXPR_SEGOFF
operator.
Peter Johnson [Mon, 26 May 2003 19:16:44 +0000 (19:16 -0000)]
Add lindex parameter to yasm_intnum_calc(), and add error messages for SEG,
WRT, and ':' (SEGOFF) usage. This change also brings the yasm_intnum_calc()
interface in line with the yasm_floatnum_calc() interface.
Note: This may not be the final place we want these error messages to reside,
but the lindex addition should remain for the sake of consistency.
Peter Johnson [Sat, 10 May 2003 20:05:39 +0000 (20:05 -0000)]
Fix crash on Linux due to double-fclose(). The NASM preprocessor was closing
the original input file, which was then closed again by the frontend. Fix
saves the original file passed in and special-checks for it before calling
fclose().
Peter Johnson [Sat, 10 May 2003 05:40:44 +0000 (05:40 -0000)]
Pre-include libyasm/coretype.h to avoid #defining functions such as
yasm__strsep() (here) before their prototypes are declared (in coretype.h).
Header protections keep coretype.h from being included again (from libyasm.h).
Peter Johnson [Mon, 5 May 2003 03:42:12 +0000 (03:42 -0000)]
Clean up and simplify libyasm.h options and symbol visibility:
- Move config.h and util.h from libyasm (and installed libyasm) to top level.
- Move yasm_* functions from util.h to coretype.h.
- Remove a number of autoconf-related YASM_*_INTERNAL options from libyasm.h.
- Rename YASM_INTERNAL to YASM_LIB_INTERNAL; it now actually means what the
comment describes: enables definitions that violate the yasm_* namespace.
While we're at it, no longer define YASM_LIB_INTERNAL from yasm frontend, so
it's closer to what a real typical libyasm-using application would look like.
Peter Johnson [Sun, 4 May 2003 22:15:09 +0000 (22:15 -0000)]
Change how bytecode and section lists are allocated. When YASM_INTERNAL is not
defined, the structures for the list heads are not defined, so the existing
yasm_bcs_initialize() and yasm_sections_initialize() were impossible to use.
Instead, rename these functions to yasm_bcs_new() and yasm_sections_new() and
make them allocate the space internally. Update yasm_bcs_delete() and
yasm_sections_delete() to free the internally-allocated space.
Peter Johnson [Sun, 4 May 2003 22:12:14 +0000 (22:12 -0000)]
dmalloc expects never to get a NULL deallocation; nasm preproc expects
nasm_free() to handle it, which it does as yasm_xfree(). But to avoid dmalloc
complaints, check for the NULL beforehand if dmalloc is in use.
Peter Johnson [Sun, 4 May 2003 20:31:57 +0000 (20:31 -0000)]
Make yasm_section_delete() static. It's unsafe to call from outside, because
the only way to allocate a section is when making it a part of a section list,
and at present, the list is singly-linked internally.
Peter Johnson [Sat, 3 May 2003 06:26:15 +0000 (06:26 -0000)]
Install modules into pkglibdir rather than libdir, and rename to type_keyword
from yasm_keyword (separating same-keyword modules of different types). Update
yasm frontend module loader to handle this.
Peter Johnson [Thu, 3 Apr 2003 06:14:29 +0000 (06:14 -0000)]
Fix crash on the valid NASM preprocessor syntax:
var: db 5
varlen equ $-var
%if varlen>100
...
%endif
by always acting like we're in preprocess-only mode and adjusting error
message appropriately.
This would be HARD to truly fix, as yasm only parses the input once.
Peter Johnson [Wed, 26 Mar 2003 05:07:57 +0000 (05:07 -0000)]
Use system includes instead of local includes. This allows replacement of
key headers in certain situations (config.h when compiling with Visual C++ for
one), and is also more correct in general.
Peter Johnson [Mon, 17 Mar 2003 00:03:02 +0000 (00:03 -0000)]
Enable more warnings and perform code cleanups to avoid them.
When -Werror is used, disable -Wconversion, because flex-generated code causes
warnings when calling fwrite() and fread().
Peter Johnson [Thu, 13 Mar 2003 04:03:59 +0000 (04:03 -0000)]
Replace --enable-dev functionality with --enable-maintainer-mode usage, other
fixes and whitespace cleanup. Renamed ANSI_CFLAGS to MORE_CFLAGS. Enable
"morewarn" along with --enable-maintainer-mode if GCC is present by default.