Commit graph

29 commits

Author SHA1 Message Date
Peter Johnson
a3a9fd2aa0 Completely revamp how label resolution is done (part of Bug#6). Now calculates
/distances/ between bytecodes in a section using bc_calc_dist() functions (a
"typical" one is provided for most occasions).  expr_expand_labelequ() is gone,
as its functionality is integrated into expr_simplify().  Currently these
changes break most bin objfmt output, as it doesn't know how to resolve
absolute labels yet.  Also, very preliminary expr support for :, SEG, and WRT
operators has been added (part of Bug#2).  Several other minor bug fixes.

svn path=/trunk/yasm/; revision=718
2002-10-01 18:56:28 +00:00
Peter Johnson
090a25b8d4 Rename intnum_new_int to intnum_new_uint, and add new signed version of
intnum_new_int.  Currently only just calls intnum_new_uint with a cast, but
eventually there may be a better way of handling signed numbers.

svn path=/trunk/yasm/; revision=708
2002-09-24 18:35:51 +00:00
Peter Johnson
7849f57e48 Fix build breakage caused by not using sect access function.
svn path=/trunk/yasm/; revision=702
2002-08-18 18:47:20 +00:00
Peter Johnson
c5ef1bf2dc Eliminate duplicate code for callbacks from expr_expand_labelequ() by moving
code and adding a resolve_precall function parameter (which caused cascading
changes in bytecode-related sources).

svn path=/trunk/yasm/; revision=701
2002-08-18 03:48:17 +00:00
Peter Johnson
ac2743de63 Prevent spurious "Circular reference detected" errors by refining the return
value for bc_resolve() to enum-defined flags.

svn path=/trunk/yasm/; revision=623
2002-05-20 01:08:42 +00:00
Peter Johnson
4407d49d66 During the first pass of basic optimization, continue reporting errors, don't
stop at the first error.
To help prevent spurios errors, make bytecodes with errors 0 length in
bc_resolve().

svn path=/trunk/yasm/; revision=621
2002-05-11 01:50:11 +00:00
Peter Johnson
0124032e2c Splint-noticed bugfixes: memory leaks, unreachable code.
svn path=/trunk/yasm/; revision=606
2002-04-23 05:04:41 +00:00
Peter Johnson
fe8c2a009f Restructure bc_calc_len() family into bc_resolve() family. Many many many
bugfixes to the bc_tobytes() family and other functions.  Binary object output
is now close to complete: just a few more bugs to kill!

svn path=/trunk/yasm/; revision=528
2002-03-18 07:16:52 +00:00
Peter Johnson
d85e7014a8 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).

svn path=/trunk/yasm/; revision=521
2002-03-17 21:58:36 +00:00
Peter Johnson
b667c33ea5 Don't call bc_resolve (it's going away soon).
FIXME: Do we really need to check completion of all sections?

svn path=/trunk/yasm/; revision=500
2002-03-15 22:19:58 +00:00
Peter Johnson
07c3299820 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).

svn path=/trunk/yasm/; revision=490
2002-03-10 23:15:14 +00:00
Peter Johnson
a0d61f00c1 Enable second pass (resolve/calculate known values).
svn path=/trunk/yasm/; revision=475
2002-02-27 05:40:46 +00:00
Peter Johnson
f5bf04dd41 Include errwarn.h to declare ErrorAt().
svn path=/trunk/yasm/; revision=474
2002-02-21 05:30:48 +00:00
Peter Johnson
964c755067 Indicate actual line number of circular reference error.
svn path=/trunk/yasm/; revision=472
2002-02-20 08:05:10 +00:00
Peter Johnson
7217fd10db Bring up-to-date with traverse function changes. Start trying to check for
circular references.

svn path=/trunk/yasm/; revision=471
2002-02-20 07:43:26 +00:00
Peter Johnson
760e3c4d11 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).

svn path=/trunk/yasm/; revision=458
2002-01-11 04:36:23 +00:00
Peter Johnson
3c0a749084 Rework resolve_label() and add a second pass.
svn path=/trunk/yasm/; revision=453
2002-01-10 05:02:40 +00:00
Peter Johnson
0276a2db37 - Use new symrec_get_label().
- Change optimize() function to return void.
- Pass LCLint.

svn path=/trunk/yasm/; revision=447
2002-01-09 09:04:41 +00:00
Peter Johnson
e23d88b957 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.

svn path=/trunk/yasm/; revision=440
2002-01-09 07:23:00 +00:00
Peter Johnson
ca6a1c8167 Massive build system change: single Makefile instead of recursive.
Note: still is automake-generated, but uses .inc files in the various
subdirectories instead of .am files.
TODO: Move arch-specific components of bytecode_test and memexpr_test to
arch/x86.

svn path=/trunk/yasm/; revision=395
2001-12-26 07:14:06 +00:00
Peter Johnson
2727869bd8 Start work on optimizer module. Moved all "post-parser-finalization" code
into the optimizer stage, where it belongs.  Naming has changed, but most
implementations have not been brought up to date to do what they say they
do.

svn path=/trunk/yasm/; revision=388
2001-12-07 03:32:05 +00:00
Peter Johnson
a7ce9bf2d1 Delete dbg optimizer (won't be useful) and add "basic" (equiv. to NASM 2-pass)
optimizer.

svn path=/trunk/yasm/; revision=364
2001-12-01 03:07:23 +00:00
Peter Johnson
a7ac50c918 Add coretype.h, make util.h do a lot more, use util.h to simplify include
sections of C files.  Also remove IdPath from top comment in files where
RCSID() is used.  Move RCSID() to immediately after util.h include.

svn path=/trunk/yasm/; revision=313
2001-11-03 05:17:51 +00:00
Peter Johnson
91f41e241b Try to fix configure and automake files so everything builds a bit cleaner.
Also try to fix the warnings on the GNU C Library.
Still a lot of work and testing to be done here, but making progress.

svn path=/trunk/yasm/; revision=204
2001-09-20 06:25:05 +00:00
Peter Johnson
e649bada33 Change ../ to $(top_builddir). It's clearer and safer.
svn path=/trunk/yasm/; revision=185
2001-09-18 06:40:45 +00:00
Peter Johnson
79295b7e9d Add rcs id.
svn path=/trunk/yasm/; revision=181
2001-09-17 23:33:15 +00:00
Peter Johnson
52847afaff Use absolute paths instead of srcdir because libintl.h is built in the
build directory.  To pass distcheck we need to do it this way.

svn path=/trunk/yasm/; revision=179
2001-09-17 23:05:52 +00:00
Peter Johnson
b2890b8f9d $Id$ -> $IdPath$.
svn path=/trunk/yasm/; revision=174
2001-09-17 04:12:20 +00:00
Peter Johnson
d758a063b2 Add barebones optimizer module framework.
svn path=/trunk/yasm/; revision=169
2001-09-16 21:39:58 +00:00