Peter Johnson [Fri, 1 Nov 2002 10:05:03 +0000 (10:05 -0000)]
Modularize errwarn. gettext()-ize in errwarn, not in every module, eliminating
libintl dependency in modules.
Also standardize initialize() and cleanup() functions.
Move replace_extension() from file.c to main.c.
Clean up some extern variable declarations in various places (particularly
nasm-compatible parser).
Peter Johnson [Sun, 27 Oct 2002 09:21:39 +0000 (09:21 -0000)]
Delete last of global variables by making a line manager and passing around
the line index. Fixes some minor line number/error message nits due to
incorrect usage of line_index in old global variable method.
Peter Johnson [Sat, 26 Oct 2002 08:25:39 +0000 (08:25 -0000)]
Dynamically load all modules (preloading some of the default ones).
Start reducing global variables for cleaner module separation.
Add rudimentary debug format module interface and "null" debug format.
Peter Johnson [Tue, 22 Oct 2002 08:42:16 +0000 (08:42 -0000)]
Get rid of expr_xform_neg_tree(), integrating its functionality into
expr_level_tree(). This fixes negative equ's and probably other issues.
This also makes expr_simplify() a macro pointing to expr_level_tree().
Peter Johnson [Tue, 22 Oct 2002 06:37:24 +0000 (06:37 -0000)]
Fix COFF_SET_VMA output (needed to add section start address to addend).
To ensure all section start addresses are known, added a first pre-pass of
sections to calculate each one's address.
Peter Johnson [Mon, 21 Oct 2002 07:38:15 +0000 (07:38 -0000)]
Run test input files through standard input instead of as input files to avoid
pathname changing issues when builddir != srcdir (previous workaround worked
for text files, but for more complex objfmts such as coff that embed the source
filename in the binary output file, we need to find a different way).
Peter Johnson [Tue, 15 Oct 2002 06:45:45 +0000 (06:45 -0000)]
Add general objfmt-specific data to symrec.
Add delete function for symrec objfmt-specific data to objfmt interface.
Delete declare_data_copy function from objfmt interface (it wasn't being called
from anywhere).
Implement functions missing from dbg objfmt.
Peter Johnson [Sat, 12 Oct 2002 07:41:39 +0000 (07:41 -0000)]
Make bytecode and effaddr "data" extensions more portable by including the
base structure as the first element in each data structure. Concept taken from
the JPEG library.
Peter Johnson [Mon, 7 Oct 2002 19:06:09 +0000 (19:06 -0000)]
Add the ability to add an additional transformation function into the execution
flow of expr_level_tree(). Feature needed for objfmts/bin upcoming fixes.
Peter Johnson [Sun, 6 Oct 2002 19:43:51 +0000 (19:43 -0000)]
Make output endian-tolerant by making intnum and floatnum output functions for
arch. This will also simplify other objfmt expr output functions. Change
file functions to use bits instead of byte/short/long, and create both little
and big endian versions. This name change caused changes in several other
files.
Peter Johnson [Sat, 5 Oct 2002 06:00:37 +0000 (06:00 -0000)]
Undo part of the tools/re2c flattening. Specifying a re2c_CFLAGS causes
automake to automatically prepend re2c- to all generated object files,
eliminating the main.o conflict. Also, it prevents extended compilation flags
from applying to the re2c build.
In Makefile.am, also allow automake to automatically include the autoconf
conditionally-included files strsep and mergesort.
Peter Johnson [Fri, 4 Oct 2002 07:23:11 +0000 (07:23 -0000)]
Make test scripts more portable by detecting echo line-ending features, using
fewer options for sed, and using a perl script for hexdump. As a side effect,
hexdumps are more accurate (the hexdump util put * for as many multiples as
were output, whereas the perl script outputs a line for every byte, no matter
what).
Peter Johnson [Thu, 3 Oct 2002 19:08:13 +0000 (19:08 -0000)]
Create a common out_test.sh test script to be used by a variety of tests.
Rename objfmts/bin/tests/*.bin.hx to *.hex to fit better in the common usage.
Peter Johnson [Thu, 3 Oct 2002 19:02:53 +0000 (19:02 -0000)]
x86_bc_resolve_insn(): If x86_expr_checkea fails, return not only
BC_RESOLVE_UNKNOWN_LEN but also BC_RESOLVE_ERROR so that a spurious circular
reference detected is not output from the basic optimizer.
Peter Johnson [Thu, 3 Oct 2002 09:26:47 +0000 (09:26 -0000)]
Fix a major bug: after switching sections, prev_bc was always being set to
NULL, causing any labels at that point to point to the start of the section
instead of the current position!
Peter Johnson [Thu, 3 Oct 2002 09:16:11 +0000 (09:16 -0000)]
expr_level_op(): Pull up IDENT-EXPR as well as EXPR-IDENT subtrees.
expr_level_tree(): Call recursively after calling expr_xform_bc_dist instead
of just calling expr_level_op, which wasn't simplifying the whole tree
properly.
Peter Johnson [Tue, 1 Oct 2002 18:56:28 +0000 (18:56 -0000)]
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.
Peter Johnson [Tue, 24 Sep 2002 18:35:51 +0000 (18:35 -0000)]
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.
Peter Johnson [Mon, 23 Sep 2002 06:16:59 +0000 (06:16 -0000)]
Move yasm core files into a libyasm shared library (avoiding backlinking).
Some cleanups still needed; a few things in globals should really be somewhere
else, or named differently.
Peter Johnson [Sun, 18 Aug 2002 03:48:17 +0000 (03:48 -0000)]
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).
Peter Johnson [Tue, 13 Aug 2002 05:56:39 +0000 (05:56 -0000)]
Finish remaining instructions (SSE, SSE2, Cyrix MMX). Changed CPU flags for
MMX/SSE2 to reflect that it's the MMX or SSE2 cpu feature, not the cpu family.