Michael Urman [Sun, 17 Mar 2002 21:58:42 +0000 (21:58 -0000)]
Lots of preparations for expanding %defines with argument lists:
- several global struct source_head's have become localized to allow
recursion
- a few more helper functions, etc.
No change in the output yet, except in the previously unsupported cases.
Peter Johnson [Sun, 17 Mar 2002 21:58:36 +0000 (21:58 -0000)]
Binary object format output! Lots of structural changes needed, particularly
with regards to resolve_label().
MAJOR FIXME: The tobytes() pass acts like a final optimization pass. This
causes internal errors because of length mismatches (optimized to shorter len).
Peter Johnson [Fri, 15 Mar 2002 07:00:12 +0000 (07:00 -0000)]
Switch to requiring autoconf 2.50. We should really be using configure.ac
instead of configure.in for the autoconf input file, but gettextize 0.10.35
complains if configure.in does not exist.
Peter Johnson [Fri, 15 Mar 2002 07:00:12 +0000 (07:00 -0000)]
Switch to requiring autoconf 2.50. We should really be using configure.ac
instead of configure.in for the autoconf input file, but gettextize 0.10.35
complains if configure.in does not exist.
Peter Johnson [Sun, 10 Mar 2002 23:15:14 +0000 (23:15 -0000)]
Add bin object format.
Changes to:
objfmt interface: added parameter to directive() for sections access.
section interface: moved start to be present for all section types.
basic optimizer: add section start to offset determination.
(much of the section start changes are due to the need to make sure offsets
don't end up being optimized into byte-sized offsets that can't be relocated).
Michael Urman [Thu, 7 Mar 2002 08:50:39 +0000 (08:50 -0000)]
Add const char *in_filename arguments to
- preproc initialize function
- parser parse function (to pass to preproc initialize)
so that the preprocessor has a clue what file it's in.
Michael Urman [Thu, 7 Mar 2002 08:32:22 +0000 (08:32 -0000)]
YAPP has arrived.
Or at least it has begun. At this point it can only handle:
%define
%if*def
%el*def
%else
%endif
%include (to some degree; needs a lot of thought, but recurses fine)
and replacing simple %defines (like %define foo bar)
And like all code, it's probably horribly inconsistent about variable
names, etc. We'll wash it later.
Peter Johnson [Thu, 7 Mar 2002 07:40:40 +0000 (07:40 -0000)]
Enhance bc_resolve() implementation a bit, but comment out, as this function
will probably disappear in the near future (its functionality will be handled
directly by the object format module without the need for another pass).
Peter Johnson [Wed, 27 Feb 2002 05:43:16 +0000 (05:43 -0000)]
Revamp object format functional interface a bit. Now, only the output()
function gets a FILE *, and it's the only function that can write to a file.
The object file is thus not opened until AFTER parsing and most error checking
is complete. Necessitated adding a special case for the dbg object format
because it needs to output to the "object" (debug) file from essentially every
function. Added a global (debug_file) to support this.
Peter Johnson [Wed, 20 Feb 2002 08:16:13 +0000 (08:16 -0000)]
Test circular reference detection. Very basic examples from NASM's docs on
critical expressions.
NASM behavior: 1-3 fail, 4 generates a 4-byte offset in the memory expression.
YASM behavior: 1&2 fail (and rightfully so :), 3 works as expected, and 4
generates a 1-byte offset.
Peter Johnson [Wed, 20 Feb 2002 07:38:41 +0000 (07:38 -0000)]
Reverse how traverse functions do early termination (now, they terminate on
a non-zero func return and return the value func returned). Document the
changes in the header files.
Peter Johnson [Wed, 20 Feb 2002 07:35:43 +0000 (07:35 -0000)]
Fix issue with how symrec's are handled when an expression is copied: old code
just assigned the pointer: but the symrec is deleted (if it's not in the symbol
table) when the expr is deleted. Thus, we need to create a copy of the symrec
instead of just reusing the same value if it's going to be deleted later. This
trickles down to objfmt to copy the objfmt-local data.
Peter Johnson [Sun, 13 Jan 2002 08:53:24 +0000 (08:53 -0000)]
Enhance error/warning framework by allowing specific warnings to be disabled,
all warnings to be disabled, and warnings to be treated as errors, much in the
style of GNU tools such as gcc.
Peter Johnson [Fri, 11 Jan 2002 04:36:23 +0000 (04:36 -0000)]
In optimize_bytecode(), calculate bc->offset *before* calling bc_calc_len().
This is because calc_len may want to know the current bytecode's offset (eg for
determining relative displacement length).
Peter Johnson [Thu, 10 Jan 2002 05:01:36 +0000 (05:01 -0000)]
Add new bc_resolve() family, and rewrite calc_len to /just/ calculate the
length, not modify anything else (particularly expressions w/temp. resolved
labels).
Peter Johnson [Wed, 9 Jan 2002 07:23:00 +0000 (07:23 -0000)]
Make resolve_label() take a symrec * instead of a section * and bytecode *.
Extend expr_expand_equ() into expr_expand_labelequ() and call resolve_label()
here.
Peter Johnson [Mon, 7 Jan 2002 07:42:27 +0000 (07:42 -0000)]
Change from current file/line dual storage to a monotonically-increasing line
"index". This fixes some problems with assumptions made by various parts of
the code that are invalidated when the line number doesn't always increase (eg.
when the NASM %line directive is used).
Speed fixes are needed to the implementation of the line_* functions in
globals.c before this is finished.