Peter Johnson [Wed, 16 Jul 2003 04:55:07 +0000 (04:55 -0000)]
Fix bug in edge case of expr_level_op(): single intnum in expression with
intnum folding on and leveling performed would result in terms getting copied
over due to hitting o != i case after i++ but no o++.
Peter Johnson [Tue, 15 Jul 2003 06:27:40 +0000 (06:27 -0000)]
yasm_intnum_new_int(): Don't always create -1 intnums (oops)
yasm_intnum_get_int(): Properly overflow and handle INTNUM_UL properly
Elsewhere: use wordptr instead of intptr.
yasm_intnum_check_size() is still broken, but the interface for this will be
changing soon, so fix it then.
Peter Johnson [Sat, 12 Jul 2003 19:44:30 +0000 (19:44 -0000)]
Avoid warnings in strsep due to glibc's bits/string2.h string inlining by
defining __NO_STRING_INLINES in strsep.c. Due to string.h inclusion in
util.h, extra level of indirection is needed
(NO_STRING_INLINES->__NO_STRING_INLINES).
Peter Johnson [Fri, 11 Jul 2003 04:08:52 +0000 (04:08 -0000)]
Note bitvect is actually triple-licensed under the Artistic License, GPL,
and LGPL. Bring in the text from the original distribution README.txt and
Artistic.txt, and add an GPL reference.
Peter Johnson [Fri, 11 Jul 2003 03:02:58 +0000 (03:02 -0000)]
Revamp intnum internals:
- Up internal format size to 128 bit.
- Use full internal format size for all calculations.
- Always store negative numbers using full internal size
(avoids 0xffffffff == -1?? issue)
This fixes many inconsistencies in handling of >32-bit intnums.
Peter Johnson [Tue, 8 Jul 2003 02:55:28 +0000 (02:55 -0000)]
Allow complex (expression) section starts, primarily used for implementation
of [ORG] in bin objfmt. Still need to assess impact of self-referential
(invalid) ORG, and how to detect for that condition.
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.