]> granicus.if.org Git - yasm/log
yasm
17 years agoUpdate version information for 0.5.0. Note build number is the changeset 0.5.0 v0.5.0
Peter Johnson [Thu, 13 Jul 2006 03:28:36 +0000 (03:28 -0000)]
Update version information for 0.5.0.  Note build number is the changeset
in which this tag was created ([1591] in this case).

svn path=/tags/yasm-0.5.0/; revision=1592

17 years agoMerge [1579] from trunk.
Peter Johnson [Thu, 15 Jun 2006 04:58:29 +0000 (04:58 -0000)]
Merge [1579] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1580

17 years agoFix farith and farithp instructions for GAS mode (e.g. fsubr).
Peter Johnson [Thu, 15 Jun 2006 04:55:47 +0000 (04:55 -0000)]
Fix farith and farithp instructions for GAS mode (e.g. fsubr).

The easiest way to fix these was to adjust the GAP input file to have NASM
and GAS versions of these instructions.

Tests added to check both NASM and GAS (farith.asm and gas-farithr.asm
respectively).

svn path=/trunk/yasm/; revision=1579

17 years agoMerge [1557] from trunk.
Peter Johnson [Fri, 9 Jun 2006 02:57:56 +0000 (02:57 -0000)]
Merge [1557] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1558

17 years agoSupport __OUTPUT_FORMAT__ (NASM naming) as alias for __YASM_OBJFMT__.
Peter Johnson [Fri, 9 Jun 2006 02:57:09 +0000 (02:57 -0000)]
Support __OUTPUT_FORMAT__ (NASM naming) as alias for __YASM_OBJFMT__.

Requested by: Mike Frysinger <vapier@gentoo.org>

svn path=/trunk/yasm/; revision=1557

17 years agoFix cross-reference filename/line number. We were reporting (wrongly) the
Peter Johnson [Thu, 8 Jun 2006 04:10:04 +0000 (04:10 -0000)]
Fix cross-reference filename/line number.  We were reporting (wrongly) the
virtual line number rather than the physical filename/line number.  This
was broken when the errwarn code was changed and not caught because I didn't
check the errwarn results closely enough for this case.

* nasm-token.re, gas-token.re: Propagate warnings from arch early.
This is a case where we probably want the double-error/warning on a single
line.

* errwarn.h: Add xref filename to yasm_print_error_func, and document all
parameters.
* errwarn.c: Get the physical file/line for xref virtual line.
* yasm.c: Update to match new yasm_print_error_func definition.

* pushf-err.errwarn: Correct test.

svn path=/trunk/yasm/; revision=1556

17 years agoMerge [1554] from trunk.
Peter Johnson [Thu, 8 Jun 2006 03:43:15 +0000 (03:43 -0000)]
Merge [1554] from trunk.
Fix test failure due to earlier merge (actually this needs to be fixed in
trunk!).

svn path=/branches/yasm-0.5.x/; revision=1555

17 years ago* x86parse.gap: Make cmpxchg16b only work as an instruction identifer in 64-bit
Peter Johnson [Thu, 8 Jun 2006 03:37:13 +0000 (03:37 -0000)]
* x86parse.gap: Make cmpxchg16b only work as an instruction identifer in 64-bit
mode.

svn path=/trunk/yasm/; revision=1554

17 years ago* nasm-bison.y: Fix compilation error introduced in [1549] merge.
Peter Johnson [Thu, 8 Jun 2006 03:29:14 +0000 (03:29 -0000)]
* nasm-bison.y: Fix compilation error introduced in [1549] merge.

svn path=/branches/yasm-0.5.x/; revision=1553

17 years agoMerge [1551] from trunk.
Peter Johnson [Thu, 8 Jun 2006 03:27:04 +0000 (03:27 -0000)]
Merge [1551] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1552

17 years agoAdd support for cmpxchg16b.
Peter Johnson [Thu, 8 Jun 2006 03:24:28 +0000 (03:24 -0000)]
Add support for cmpxchg16b.

Noticed by: Cory Nelson <phrosty@gmail.com>

svn path=/trunk/yasm/; revision=1551

17 years agoMerge [1548] from trunk.
Peter Johnson [Tue, 6 Jun 2006 04:29:46 +0000 (04:29 -0000)]
Merge [1548] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1549

18 years agoFix use of arithmetic with single-character constants in data declarations.
Peter Johnson [Thu, 1 Jun 2006 06:40:12 +0000 (06:40 -0000)]
Fix use of arithmetic with single-character constants in data declarations.
Multi-character constants are still not valid, as they are somewhat
difficult to handle without adding some sort of string handling into
yasm_expr.  This fix may break big-endian targets (we don't have any yet).

* nasm-bison.y: Add new token ONECHARSTR.  Add string rule that takes
STRING and ONECHARSTR; use this instead of STRING everywhere but dataval.
In dvexpr, take ONECHARSTR as character constant.
* nasm-token.re: Generate ONECHARSTR for one-character string contants.

Reported by: Robert Riebisch <rr@bttr-software.de>

svn path=/trunk/yasm/; revision=1548

18 years ago* bc-data.c (yasm_bc_create_data): Fix crash on empty string (e.g. db '').
Peter Johnson [Thu, 1 Jun 2006 05:50:27 +0000 (05:50 -0000)]
* bc-data.c (yasm_bc_create_data): Fix crash on empty string (e.g. db '').

svn path=/trunk/yasm/; revision=1547

18 years agoMerge [1542] from trunk.
Peter Johnson [Mon, 22 May 2006 06:20:02 +0000 (06:20 -0000)]
Merge [1542] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1543

18 years ago* x86parse.gap: Update pushf generation to match popf for legalization and
Peter Johnson [Mon, 22 May 2006 06:19:04 +0000 (06:19 -0000)]
* x86parse.gap: Update pushf generation to match popf for legalization and
prefix regarding pushfq vs 64-bit mode.
* pushf.asm, pushf-err.asm: New tests for pushf and popf in all modes.

Reported by: Vivek Mohan <vivek.mt@gmail.com>

svn path=/trunk/yasm/; revision=1542

18 years agoMerge [1540] from trunk.
Peter Johnson [Fri, 12 May 2006 02:16:33 +0000 (02:16 -0000)]
Merge [1540] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1541

18 years ago* x86id.c: Add support for 64-bit far jmp/call. These are not listed in the
Peter Johnson [Fri, 12 May 2006 02:12:19 +0000 (02:12 -0000)]
* x86id.c: Add support for 64-bit far jmp/call.  These are not listed in the
AMD64 ISA reference but are in the Intel EM64T reference.
* x86arch.h: Add CPU_EM64T flag.
* x86parse.gap: Add CPU_EM64T as feature and enable it as part of "prescott".
* far64.asm: Test for 64-bit far jmp/call.

svn path=/trunk/yasm/; revision=1540

18 years ago* value.c (yasm_value_output_basic): The destsize parameter accidentally got
Peter Johnson [Fri, 12 May 2006 02:00:04 +0000 (02:00 -0000)]
* value.c (yasm_value_output_basic): The destsize parameter accidentally got
out of sync with the header file (should be size_t).

svn path=/trunk/yasm/; revision=1539

18 years agoMerge [1536] from trunk.
Peter Johnson [Thu, 11 May 2006 07:19:27 +0000 (07:19 -0000)]
Merge [1536] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1538

18 years agoMerge [1535] from trunk.
Peter Johnson [Thu, 11 May 2006 07:18:39 +0000 (07:18 -0000)]
Merge [1535] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1537

18 years agoFix major bug related to multiple handling. Unfortunately this slows down
Peter Johnson [Thu, 11 May 2006 07:00:33 +0000 (07:00 -0000)]
Fix major bug related to multiple handling.  Unfortunately this slows down
bytecode multiple output significantly, but this way handles generating
relocations correctly (otherwise extern foo; times 5 dd foo doesn't work!).

* bytecode.h (yasm_bc_tobytes): Remove multiple output parameter.
(yasm_bc_get_multiple): New.
* bytecode.c (yasm_bc_tobytes): Update to iterate through multiple here.
(yasm_bc_get_multiple): New.
* xdf-objfmt.c, elf-objfmt.c, bin-objfmt.c, coff-objfmt.c: Don't iterate
through multiple here.
* nasm-listfmt.c: Use yasm_bc_get_multiple() to get multiple instead of
yasm_bc_tobytes().

* bytecode.pxi: Update.

* tests/win32-relocovfl.asm: Tests both this and [1534] but generates too
huge of a file (3MB) to be put into the automated tests.

svn path=/trunk/yasm/; revision=1536

18 years ago* coff-objfmt.c: Support >=64K relocs on Win32/64 objects.
Peter Johnson [Thu, 11 May 2006 05:43:22 +0000 (05:43 -0000)]
* coff-objfmt.c: Support >=64K relocs on Win32/64 objects.

svn path=/trunk/yasm/; revision=1535

18 years ago* coretype.h (yasm_value): Add size field (specified in bits).
Peter Johnson [Wed, 10 May 2006 08:54:52 +0000 (08:54 -0000)]
* coretype.h (yasm_value): Add size field (specified in bits).
(yasm_value_output_func): Remove valsize and shift parameters.
* bytecode.h (yasm_effaddr): Remove disp_len, replacing with
need_nonzero_len.
(yasm_immval): Remove len.
* value.h (yasm_value_initialize): Add size parameter.
(yasm_value_finalize_expr): Likewise.
(yasm_value_output_basic): Remove valsize and shift parameters.

Update all implementations and users for the above.

* intnum.c (yasm_intnum_calc): Fix bug in shift right (was doing a logical
instead of arithmetic shift).

* lc3b-basic.asm, lc3b-basic.errwarn, lc3b-basic.hex: Update based on
fixed warnings.

svn path=/trunk/yasm/; revision=1534

18 years ago* Mkfiles: Update to match [1532].
Peter Johnson [Wed, 10 May 2006 04:18:45 +0000 (04:18 -0000)]
* Mkfiles: Update to match [1532].

svn path=/trunk/yasm/; revision=1533

18 years ago* bc-int.h (yasm_bytecode_callback): Add reserve flag to indicate if the
Peter Johnson [Wed, 10 May 2006 04:18:23 +0000 (04:18 -0000)]
* bc-int.h (yasm_bytecode_callback): Add reserve flag to indicate if the
bytecode outputs just space and not data.
* bytecode.pxi: Update to match.
* bytecode.c (yasm_bc_tobytes): Use reserve flag instead of checking
against bytecode_reserve as special case.
* dwarf2-info.c, dwarf2-line.c, dwarf2-dbgfmt.c, cv-symline.c, cv-type.c,
* stabs-dbgfmt.c, lc3bbc.c, x86bc.c: Update to set reserve=0.

* bc-align.c, bc-insn.c, bc-reserve.c, bc-org.c, bc-incbin.c, bc-data.c,
* bytecode.c: Split out bytecodes into separate files.  While we're here,
merge LEB128 into general data bytecode.

svn path=/trunk/yasm/; revision=1532

18 years ago* expr.c (expr_get_item): Refactor itempool code.
Peter Johnson [Tue, 9 May 2006 05:17:44 +0000 (05:17 -0000)]
* expr.c (expr_get_item): Refactor itempool code.

svn path=/trunk/yasm/; revision=1531

18 years agoTry to combine as much data as possible into single raw (used to be string)
Peter Johnson [Mon, 8 May 2006 08:08:15 +0000 (08:08 -0000)]
Try to combine as much data as possible into single raw (used to be string)
dataval data bytecode blocks.  This drastically cuts down on dataval
overhead for large sets of constant data (savings of 30% or more on peak
memory usage in some cases).  We may try to improve this even more down the
road by doing things like combining across multiple data bytecodes and
converting constant instructions into raw bytes.

* bytecode.c (yasm_bc_create_data): Add (optional) yasm_arch operand so that
bytes can be generated from constant values of >1 byte size.  Do as much
simplification to constant raw bytes here as possible.
(bytecode_data): No longer a need to remember append_zero.
(bc_data_resolve, bc_data_output): Update to not handle append_zero.
(yasm_dataval): Rename string to raw.
(yasm_dv_create_string): Rename to:
(yasm_dv_create_raw): Here.

* bytecode.h (yasm_dv_create_string): Change into macro that casts parameters
into yasm_dv_create_raw().
(yasm_dv_create_raw): New.

modules: Update for new yasm_bc_create_data() parameter.

svn path=/trunk/yasm/; revision=1530

18 years ago* expr.c: Don't hit the allocator so hard with tiny temporary requests when
Peter Johnson [Mon, 8 May 2006 07:51:23 +0000 (07:51 -0000)]
* expr.c: Don't hit the allocator so hard with tiny temporary requests when
creating expressions; instead, keep a pool of 31 yasm_expr__items and pull
from those instead of malloc/free'ing.

svn path=/trunk/yasm/; revision=1529

18 years agoAdd/Use helpers to pass void* as manually type-checked PyCObjects.
Michael Urman [Sun, 7 May 2006 18:23:33 +0000 (18:23 -0000)]
Add/Use helpers to pass void* as manually type-checked PyCObjects.

svn path=/trunk/yasm/; revision=1528

18 years agoRework yasm.Expression to accept strings like '+' to indicate operation.
Michael Urman [Sun, 7 May 2006 16:41:16 +0000 (16:41 -0000)]
Rework yasm.Expression to accept strings like '+' to indicate operation.
Add tests for yasm.Expression and new yasm.ImmVal.

svn path=/trunk/yasm/; revision=1527

18 years agoRaise SymbolTable redefinition errors in Python.
Michael Urman [Sun, 7 May 2006 03:22:03 +0000 (03:22 -0000)]
Raise SymbolTable redefinition errors in Python.
Fix a double-free problem encountered during this testing.
Redefine symtab.define_special() vis parameter to match symrec.visibility.

svn path=/trunk/yasm/; revision=1526

18 years ago* errwarn.c (yasm_error_matches): Make real function, fix a bug with checking
Peter Johnson [Sun, 7 May 2006 02:35:50 +0000 (02:35 -0000)]
* errwarn.c (yasm_error_matches): Make real function, fix a bug with checking
against YASM_ERROR_GENERAL errors.
* errwarn.h (yasm_error_matches): Remove #defined function.

svn path=/trunk/yasm/; revision=1525

18 years agoRaise IntNum division by zero errors in Python.
Michael Urman [Sat, 6 May 2006 19:12:05 +0000 (19:12 -0000)]
Raise IntNum division by zero errors in Python.

svn path=/trunk/yasm/; revision=1524

18 years ago* lc3barch.c (lc3b_get_fill): Fix type-punning warning on GCC 4.1.
Peter Johnson [Sat, 6 May 2006 16:11:56 +0000 (16:11 -0000)]
* lc3barch.c (lc3b_get_fill): Fix type-punning warning on GCC 4.1.
* x86arch.c (x86_get_fill): Likewise.
* yasm.c: Fix long-standing warning.

svn path=/trunk/yasm/; revision=1523

18 years ago* errwarn.h (yasm_warn_set, yasm_warn_set_va): Fix doxygen arg list comments.
Peter Johnson [Fri, 5 May 2006 03:02:42 +0000 (03:02 -0000)]
* errwarn.h (yasm_warn_set, yasm_warn_set_va): Fix doxygen arg list comments.

svn path=/trunk/yasm/; revision=1522

18 years agoRevamp error/warning handling, using a model similar to Python's internal
Peter Johnson [Thu, 4 May 2006 07:55:32 +0000 (07:55 -0000)]
Revamp error/warning handling, using a model similar to Python's internal
exception handling.  There are now two layers an error or warning goes
through before it hits the user: first an error is logged via
yasm_error_set() (or yasm_warn_set() for a warning).  Only one error may
be set, whereas multiple warnings can be set (yasm_warn_set maintains a
linked list).  Then, calling yasm_errwarn_propagate() propagates any error
and/or warning(s) to an errwarns structure and associates the
errors/warnings with a line number at that time; this call also clears the
pending errors/warnings and allows new ones to be set.  The propagate
function can safely be called when there are no pending error/warnings.

In addition, there are some helper errwarn functions that allow clearing of
an error/warning without propagating, getting it separately, etc.

Still yet to be done: changing most/all uses of yasm_internal_error() into
yasm_error_set(YASM_ERROR_ASSERTION).

The main advantage this change has is making libyasm functions feel much
more library like, and separating the user code line numbers from the inner
function error handling (e.g. intnum create functions only needed the line
number to trigger errors; this is no longer required).

The set/propagate/etc functions use global data structures to avoid passing
around a pointer to every function.  This would need to be made thread-local
data in a threaded app.  Errwarns containers (that keep associated line
numbers) are no longer global, so multiple source streams can be processed
separately with no conflict (at least if there's only a single thread of
execution).

svn path=/trunk/yasm/; revision=1521

18 years agoMerge [1519] from trunk.
Peter Johnson [Thu, 4 May 2006 04:01:19 +0000 (04:01 -0000)]
Merge [1519] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1520

18 years ago* ax_create_stdint_h.m4: Fix a couple bugs.
Peter Johnson [Thu, 4 May 2006 03:59:39 +0000 (03:59 -0000)]
* ax_create_stdint_h.m4: Fix a couple bugs.
The m4_ifvaln() call doesn't seem to serve a purpose and generated bad shell
script code (trying to actually run a header file).
_STDINT_HEADER_INTPTR ifdef shouldn't wrap INTMAX_T check.

svn path=/trunk/yasm/; revision=1519

18 years ago* configure.ac: Don't error-out configure if Python not found; Python is
Peter Johnson [Wed, 3 May 2006 02:47:01 +0000 (02:47 -0000)]
* configure.ac: Don't error-out configure if Python not found; Python is
completely optional.

Noticed by: Stephen Polkowski <stephen@centtech.com>

svn path=/trunk/yasm/; revision=1518

18 years agoMerge [1516] from trunk.
Peter Johnson [Sun, 30 Apr 2006 05:52:01 +0000 (05:52 -0000)]
Merge [1516] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1517

18 years ago* elf.c (elf_strtab_enty_set_str): Update following strtab indices since
Peter Johnson [Sun, 30 Apr 2006 05:50:43 +0000 (05:50 -0000)]
* elf.c (elf_strtab_enty_set_str): Update following strtab indices since
string length can change.  This was breaking symbol name lookups when the
filename was changed (e.g. for dwarf2).
* dwarf32_testhd.hex, dwarf64_leb128.hex: Fix testcases so they're correct.

svn path=/trunk/yasm/; revision=1516

18 years agoMerge [1514] from trunk.
Peter Johnson [Thu, 27 Apr 2006 03:50:59 +0000 (03:50 -0000)]
Merge [1514] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1515

18 years ago* nasm-bison.y (nasm_parser_directive): The objfmt directive must be the last
Peter Johnson [Thu, 27 Apr 2006 03:48:57 +0000 (03:48 -0000)]
* nasm-bison.y (nasm_parser_directive): The objfmt directive must be the last
directive called; thus reorder dbgfmt_directive and objfmt_directive calls.

svn path=/trunk/yasm/; revision=1514

18 years agoMerge [1511] and [1512] from trunk.
Peter Johnson [Wed, 26 Apr 2006 06:37:12 +0000 (06:37 -0000)]
Merge [1511] and [1512] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1513

18 years ago* x86id.c (yasm_x86__finalize_insn): Don't check for explicit 64-bit
Peter Johnson [Wed, 26 Apr 2006 06:35:46 +0000 (06:35 -0000)]
* x86id.c (yasm_x86__finalize_insn): Don't check for explicit 64-bit
effective address size in GAS mode.  Doing this breaks movabs.
* gas-movabs.asm: Test this.

svn path=/trunk/yasm/; revision=1512

18 years ago* hamt.c (HAMT_insert): Avoid hash collisions by checking full string on hash
Peter Johnson [Wed, 26 Apr 2006 04:55:01 +0000 (04:55 -0000)]
* hamt.c (HAMT_insert): Avoid hash collisions by checking full string on hash
match.

svn path=/trunk/yasm/; revision=1511

18 years agoMerge [1508] and [1509] from trunk.
Peter Johnson [Tue, 25 Apr 2006 04:45:18 +0000 (04:45 -0000)]
Merge [1508] and [1509] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1510

18 years ago* nasm-bison.y: Enable dbgfmt directives from NASM parser. This allows e.g.
Peter Johnson [Tue, 25 Apr 2006 03:42:45 +0000 (03:42 -0000)]
* nasm-bison.y: Enable dbgfmt directives from NASM parser.  This allows e.g.
loc and file DWARF2 directives to be accessed using [loc ...] and [file ...]
just like .loc and .file work from the GAS parser.

svn path=/trunk/yasm/; revision=1509

18 years ago* nasm-token.re: Actually handle $-prefixed names correctly, stripping the $ prefix...
Peter Johnson [Mon, 24 Apr 2006 05:53:26 +0000 (05:53 -0000)]
* nasm-token.re: Actually handle $-prefixed names correctly, stripping the $ prefix and allowing
any combination of characters following.
* win64-dataref.asm: Update to match (has a $-prefixed symbol).

Reported by: Nils Weller <nils@gnulinux.nl>

svn path=/trunk/yasm/; revision=1508

18 years agoMerge [1506] from trunk.
Peter Johnson [Sat, 22 Apr 2006 04:13:49 +0000 (04:13 -0000)]
Merge [1506] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1507

18 years ago* nasm-preproc.c (nasm_preproc_input): Don't generate %line except at the
Peter Johnson [Sat, 22 Apr 2006 04:08:00 +0000 (04:08 -0000)]
* nasm-preproc.c (nasm_preproc_input): Don't generate %line except at the
beginning of a line.  The old way could insert a %line in the middle of very
long lines (e.g. >8192 chars).
* longline.asm: Test with an ~8500 character line.

Reported by: Brian Gladman <brg@gladman.plus.com>

svn path=/trunk/yasm/; revision=1506

18 years agoMerge [1504] from trunk.
Peter Johnson [Tue, 18 Apr 2006 05:53:42 +0000 (05:53 -0000)]
Merge [1504] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1505

18 years ago* gas-bison.y: Handle segment register operands, fixing #74.
Peter Johnson [Tue, 18 Apr 2006 05:52:03 +0000 (05:52 -0000)]
* gas-bison.y: Handle segment register operands, fixing #74.
* gas-push.asm: Test this.

svn path=/trunk/yasm/; revision=1504

18 years ago* symrec.pxi: Change various things to properties rather than functions.
Peter Johnson [Mon, 17 Apr 2006 05:36:47 +0000 (05:36 -0000)]
* symrec.pxi: Change various things to properties rather than functions.
Visibility is handled via set of strings.
* test_symrec.py: Test.

svn path=/trunk/yasm/; revision=1503

18 years ago* python_test.sh: Set srcdir and PYTHON to reasonable defaults if not already
Peter Johnson [Mon, 17 Apr 2006 03:53:04 +0000 (03:53 -0000)]
* python_test.sh: Set srcdir and PYTHON to reasonable defaults if not already
set, this allows easy manual execution of this script outside of make check.

svn path=/trunk/yasm/; revision=1502

18 years ago* python_test.sh: Use PYTHON variable to find python executable.
Peter Johnson [Mon, 17 Apr 2006 03:21:41 +0000 (03:21 -0000)]
* python_test.sh: Use PYTHON variable to find python executable.
* python-yasm/tests/Makefile.inc: Pass PYTHON setting down through
TESTS_ENVIRONMENT.
* Makefile.am: Initialize TESTS_ENVIRONMENT to empty.

svn path=/trunk/yasm/; revision=1501

18 years ago* intnum.c (yasm_intnum_calc): Use BitVector_Compare, not Lexicompare;
Peter Johnson [Mon, 17 Apr 2006 03:06:44 +0000 (03:06 -0000)]
* intnum.c (yasm_intnum_calc): Use BitVector_Compare, not Lexicompare;
intnums are signed, and Compare is the signed comparison function.

svn path=/trunk/yasm/; revision=1500

18 years agoAdd intnum tests; test_cmp is failing right now and needs a source fix.
Michael Urman [Mon, 17 Apr 2006 02:16:50 +0000 (02:16 -0000)]
Add intnum tests; test_cmp is failing right now and needs a source fix.

svn path=/trunk/yasm/; revision=1499

18 years ago* test_symrec.py: Actually add test, and fix it to work.
Peter Johnson [Mon, 17 Apr 2006 02:13:52 +0000 (02:13 -0000)]
* test_symrec.py: Actually add test, and fix it to work.

svn path=/trunk/yasm/; revision=1498

18 years ago* python-yasm: Add test framework; large portions copied from Quod Libet
Peter Johnson [Mon, 17 Apr 2006 02:04:00 +0000 (02:04 -0000)]
* python-yasm: Add test framework; large portions copied from Quod Libet
framework.

svn path=/trunk/yasm/; revision=1497

18 years ago* symrec.pxi: Remove duplicate l.appends() in values() and items().
Peter Johnson [Mon, 17 Apr 2006 01:00:43 +0000 (01:00 -0000)]
* symrec.pxi: Remove duplicate l.appends() in values() and items().

svn path=/trunk/yasm/; revision=1496

18 years ago* symrec.pxi: Implement iterators.
Peter Johnson [Sun, 16 Apr 2006 22:46:22 +0000 (22:46 -0000)]
* symrec.pxi: Implement iterators.
* symrec.h (yasm_symtab_first, yasm_symtab_next, yasm_symtab_iter_value):
Supporting functions.
* symrec.c (yasm_symtab_first, yasm_symtab_next, yasm_symtab_iter_value):
Implement by passing through to...
* hamt.h (HAMT_first, HAMT_next, HAMTEntry_get_data): New.
* hamt.c (HAMT_first, HAMT_next, HAMTEntry_get_data): Implement.

svn path=/trunk/yasm/; revision=1495

18 years agosymrec.pxi: Implement __contains__ so that "'foo' in SymbolTable" works.
Peter Johnson [Sun, 16 Apr 2006 20:28:07 +0000 (20:28 -0000)]
symrec.pxi: Implement __contains__ so that "'foo' in SymbolTable" works.

svn path=/trunk/yasm/; revision=1494

18 years ago* nasm-eval.c (expr5, expr6): Remove unused variables.
Peter Johnson [Sun, 16 Apr 2006 19:18:33 +0000 (19:18 -0000)]
* nasm-eval.c (expr5, expr6): Remove unused variables.

svn path=/trunk/yasm/; revision=1493

18 years ago* floatnum.pxi: yasm_floatnum doesn't support any ops other than NEG,
Peter Johnson [Sun, 16 Apr 2006 08:48:28 +0000 (08:48 -0000)]
* floatnum.pxi: yasm_floatnum doesn't support any ops other than NEG,
other cleanups along the lines of intnum.

svn path=/trunk/yasm/; revision=1492

18 years ago* symrec.pxi: Revamp to more correctly generate Symbol objects, support
Peter Johnson [Sun, 16 Apr 2006 08:41:41 +0000 (08:41 -0000)]
* symrec.pxi: Revamp to more correctly generate Symbol objects, support
most dictionary functions (but not yet iterator protocol).
* yasm.pyx: Add Py_INCREF, Py_DECREF, malloc, free externals.
* coretype.pxi: Rename c_print to print_, add some missing yasm_expr_op
enum values.

svn path=/trunk/yasm/; revision=1491

18 years ago* intnum.pxi: Use correct name for NotImplementedError.
Peter Johnson [Sun, 16 Apr 2006 02:56:54 +0000 (02:56 -0000)]
* intnum.pxi: Use correct name for NotImplementedError.

svn path=/trunk/yasm/; revision=1490

18 years ago* intnum.pxi: Implement full set of integer and comparison functions.
Peter Johnson [Sun, 16 Apr 2006 02:27:01 +0000 (02:27 -0000)]
* intnum.pxi: Implement full set of integer and comparison functions.

svn path=/trunk/yasm/; revision=1489

18 years ago* intnum.c (yasm_intnum_create_sized): New, reverse function of
Peter Johnson [Sat, 15 Apr 2006 09:59:17 +0000 (09:59 -0000)]
* intnum.c (yasm_intnum_create_sized): New, reverse function of
yasm_intnum_get_sized().
* intnum.h (yasm_intnum_create_sized): Prototype.

* yasm.pyx: Bring in _PyLong_From/AsByteArray functions.
* intnum.pyx: Use yasm_intnum_create_sized(), etc to implement full 128-bit
number handling.

* intnum.c (yasm_intnum_get_str): Return strings in hex rather than in
decimal.

svn path=/trunk/yasm/; revision=1488

18 years ago* python-yasm/Makefile.inc: .python_build needs to depend on
Peter Johnson [Sat, 15 Apr 2006 08:43:54 +0000 (08:43 -0000)]
* python-yasm/Makefile.inc: .python_build needs to depend on
libyasm_a_SOURCES otherwise the Python bindings don't get updated when
libyasm changes.

svn path=/trunk/yasm/; revision=1487

18 years ago* python-yasm/Makefile.inc: Since we aren't using buildtools to call Pyrex,
Peter Johnson [Sat, 15 Apr 2006 08:03:42 +0000 (08:03 -0000)]
* python-yasm/Makefile.inc: Since we aren't using buildtools to call Pyrex,
we shouldn't need to remove the build directory.  Not removing it speeds up
the build considerably (we don't have to rebuild all of the Python bindings
just because the Makefile changed, for example).

svn path=/trunk/yasm/; revision=1486

18 years agoChange the NASM preprocessor to use yasm_intnum and yasm_expr. This
Peter Johnson [Sat, 15 Apr 2006 04:06:44 +0000 (04:06 -0000)]
Change the NASM preprocessor to use yasm_intnum and yasm_expr.  This
decreases bloat and more importantly makes it possible to use >32-bit values
in the preprocessor.

This has NOT been heavily tested, so there may easily be bugs.  I've not yet
decided whether to merge this to 0.5.0 final for this reason.

Inspired by: Jason Chen <jchen@centtech.com> patches to use "long long"
rather than "long" in the preprocessor to enable >32-bit values.

* coretype.h (yasm_op): Add XNOR, LXOR, LXNOR, LNOR.
* intnum.c (yasm_intnum_calc): Calculate the above.
* expr.c (expr_is_constant, expr_can_destroy_int_left)
(expr_can_destroy_int_right, ...): Actually handle logical operations,
including the new ones.

* intnum.c (yasm_intnum_get_str): New; gets a signed decimal string
representation of an intnum.
* intnum.h (yasm_intnum_get_str): Prototype.

* nasmlib.c (nasm_strcat): Change parameters to const.
* nasmlib.h (nasm_strcat): Update prototype.

* nasm-preproc.c (nasm_preproc_input): Close a memory leak.

* nasm.h: Clean out a lot of cruft we don't use.
(tokenval): Change t_integer and t_inttwo to yasm_intnums.
(evalfunc): Remove fwref and hints parameters (cleanup), change return value
to yasm_expr.
* nasm-eval.c: Massively rewrite to just call appropriate yasm_expr creation
functions rather than calculating the value here.  Overall recursive descent
parsing structure is unchanged.
* nasmlib.c: Remove a lot of now-unused functions.
(nasm_readnum): Use yasm_intnum functions and return that.
(nasm_readstrnum): Likewise.
* nasmlib.h: Update prototypes.
* nasm-pp.c: Change to use intnum/expr as necessary.
* nasm-preproc.c (nasm_preproc_destroy): Don't call nasm_eval_cleanup,
it's been deleted.

* nasmpp-bigint.asm: New test for >32-bit preproc values.
* ifcritical-err.errwarn: The new code doesn't generate a duplicate warning.

svn path=/trunk/yasm/; revision=1485

18 years agoMerge [1480] and [1481] from trunk.
Peter Johnson [Wed, 12 Apr 2006 04:30:50 +0000 (04:30 -0000)]
Merge [1480] and [1481] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1482

18 years agoCorrectly handle input characters >127 by using unsigned char in the re2c
Peter Johnson [Wed, 12 Apr 2006 04:06:44 +0000 (04:06 -0000)]
Correctly handle input characters >127 by using unsigned char in the re2c
tokenizers.  Signed chars >127 are negative, and thus aren't caught by the
[\000-\377] range.
* gas-parser.h (YYCTYPE): Change to unsigned char.
* gas-bison.y, gas-token.re: Cast as necessary to char.
* nasm-parser.h, nasm-bison.y, nasm-token.re: Likewise.
* lc3bid.re: Likewise.

svn path=/trunk/yasm/; revision=1481

18 years ago* ax_create_stdint_h.m4: Don't bother using head -1 to get the first line of
Peter Johnson [Sun, 9 Apr 2006 06:05:37 +0000 (06:05 -0000)]
* ax_create_stdint_h.m4: Don't bother using head -1 to get the first line of
gcc --version; this is just extra information.  POSIX needs -n 1 instead of
-1; instead of dealing with this, just disable this function.

Noticed by: Vikas Kumar <walburn@gmail.com>

svn path=/trunk/yasm/; revision=1480

18 years agoMerge [1478] from trunk.
Peter Johnson [Sat, 8 Apr 2006 18:36:33 +0000 (18:36 -0000)]
Merge [1478] from trunk.

svn path=/branches/yasm-0.5.x/; revision=1479

18 years agoIn dwarf2, don't create symbols that are not in the table but will show up in
Peter Johnson [Sat, 8 Apr 2006 18:32:57 +0000 (18:32 -0000)]
In dwarf2, don't create symbols that are not in the table but will show up in
a relocation.  This can break some object formats (e.g. Win64).

svn path=/trunk/yasm/; revision=1478

18 years agoBump trunk internal version to 0.5.99.0.
Peter Johnson [Fri, 7 Apr 2006 05:13:24 +0000 (05:13 -0000)]
Bump trunk internal version to 0.5.99.0.

svn path=/trunk/yasm/; revision=1476

18 years agoBump 0.5.x branch internal version to 0.5.1.0.
Peter Johnson [Fri, 7 Apr 2006 05:11:17 +0000 (05:11 -0000)]
Bump 0.5.x branch internal version to 0.5.1.0.

svn path=/branches/yasm-0.5.x/; revision=1475

18 years agoMissed merging [1463] (oops).
Peter Johnson [Fri, 7 Apr 2006 04:43:23 +0000 (04:43 -0000)]
Missed merging [1463] (oops).

svn path=/branches/yasm-0.5.x/; revision=1473

18 years agoMerge [1463]-[1469] from trunk, updating version as appropriate.
Peter Johnson [Fri, 7 Apr 2006 02:59:00 +0000 (02:59 -0000)]
Merge [1463]-[1469] from trunk, updating version as appropriate.

svn path=/branches/yasm-0.5.x/; revision=1470

18 years ago* xstrdup.c: Remove compatibility shims that, due to this file's inclusion in gap...
Peter Johnson [Fri, 7 Apr 2006 01:47:30 +0000 (01:47 -0000)]
* xstrdup.c: Remove compatibility shims that, due to this file's inclusion in gap, broke DJGPP
build.

svn path=/trunk/yasm/; revision=1469

18 years agoTake #2 on reversioning: decouple version and build from autoconf version
Peter Johnson [Thu, 6 Apr 2006 05:55:41 +0000 (05:55 -0000)]
Take #2 on reversioning: decouple version and build from autoconf version
(which is used for the tar.gz name).  Also clean up Mkfiles/config.h

* configure.ac: Change autoconf version back to HEAD, add new PACKAGE_INTVER
and PACKAGE_BUILD config.h defines.
* cv-symline.c, yasm.c: Use PACKAGE_INTVER and PACKAGE_BUILD instead of
PACKAGE_STRING.
* genversion.c: Likewise.

* Mkfiles: Clean up and add PACKAGE_INTVER and PACKAGE_BUILD.

svn path=/trunk/yasm/; revision=1468

18 years ago* Mkfiles: Fix genversion include paths.
Peter Johnson [Thu, 6 Apr 2006 01:54:07 +0000 (01:54 -0000)]
* Mkfiles: Fix genversion include paths.

Thanks to: Brian Gladman for vcproj fixes.

svn path=/trunk/yasm/; revision=1467

18 years ago* Mkfiles: Bring up to date with main tree changes (genstring, genversion).
Peter Johnson [Wed, 5 Apr 2006 07:53:55 +0000 (07:53 -0000)]
* Mkfiles: Bring up to date with main tree changes (genstring, genversion).

svn path=/trunk/yasm/; revision=1466

18 years ago* vc8/config.h, vc/config.h, dj/config.h: Update version information.
Peter Johnson [Wed, 5 Apr 2006 07:16:20 +0000 (07:16 -0000)]
* vc8/config.h, vc/config.h, dj/config.h: Update version information.

svn path=/trunk/yasm/; revision=1465

18 years agoImplement better versioning. From now on, trunk's version will be the
Peter Johnson [Wed, 5 Apr 2006 07:14:41 +0000 (07:14 -0000)]
Implement better versioning.  From now on, trunk's version will be the
current major and minor version but with subminor version = 99.  All releases
and snapshots will have a build version of the current svn version.  Version
information is put into predefined macros in the NASM preproc:
__YASM_MAJOR__, __YASM_MINOR__, __YASM_SUBMINOR__, __YASM_BUILD__,
__YASM_VERSION_ID__, __YASM_VER__.
__YASM_VER__ does not have the build version as part of the string, and
__YASM_VERSION_ID__ does not incorporate the build version.
If the build version is "HEAD" (or other non-numeric), __YASM_BUILD__ is
set to 0.

* configure.ac: Set version to 0.4.99.HEAD for trunk.
* genversion.c: Generate version.mac for the NASM preproc version macros.
* Makefile.inc: Hook into build.

svn path=/trunk/yasm/; revision=1464

18 years ago* COPYING: Update verbiage, add list of contributors and copyright notice.
Peter Johnson [Wed, 5 Apr 2006 05:39:23 +0000 (05:39 -0000)]
* COPYING: Update verbiage, add list of contributors and copyright notice.

* genstring.c: Generate string array from source file.
* Makefile.am: Build genstring.
* Makefile.inc: Use genstring to create license.c from COPYING.
* yasm.c: Include license.c and use it for new --license option.  Shorten
--version option to just displaying version, compile date, and very short
copyright message.

svn path=/trunk/yasm/; revision=1463

18 years ago* setup.py: strip() opts["srcdir"] to unbreak distcheck.
Peter Johnson [Wed, 5 Apr 2006 05:36:06 +0000 (05:36 -0000)]
* setup.py: strip() opts["srcdir"] to unbreak distcheck.

svn path=/trunk/yasm/; revision=1462

18 years ago* setup.py: Incorporate cleanups suggested by Michael Urman.
Peter Johnson [Wed, 5 Apr 2006 03:37:46 +0000 (03:37 -0000)]
* setup.py: Incorporate cleanups suggested by Michael Urman.

svn path=/trunk/yasm/; revision=1461

18 years agoQuiet warnings in Pyrex code by adding "-w" if GCC detected.
Peter Johnson [Wed, 5 Apr 2006 02:26:19 +0000 (02:26 -0000)]
Quiet warnings in Pyrex code by adding "-w" if GCC detected.
* configure.ac: Pass GCC value to Makefile
* Makefile.inc: Pass GCC value to python-setup.txt
* setup.py: Check GCC value and append -w if necessary.

svn path=/trunk/yasm/; revision=1460

18 years ago* Makefile.am: Unbreak build for when Python bindings aren't being built;
Peter Johnson [Wed, 5 Apr 2006 02:05:19 +0000 (02:05 -0000)]
* Makefile.am: Unbreak build for when Python bindings aren't being built;
also more cleanly hook into all target.

svn path=/trunk/yasm/; revision=1459

18 years ago* pyrex.m4: Add a little documentation.
Peter Johnson [Tue, 4 Apr 2006 08:06:39 +0000 (08:06 -0000)]
* pyrex.m4: Add a little documentation.
* setup.py, yasm.pyx, *.pxi: Add copyright/license.

svn path=/trunk/yasm/; revision=1458

18 years agoBe much smarter at checking for and running Pyrex. Pyrex is a Python module
Peter Johnson [Tue, 4 Apr 2006 07:51:42 +0000 (07:51 -0000)]
Be much smarter at checking for and running Pyrex.  Pyrex is a Python module
and the "pyrexc" command is just a wrapper, so instead of looking for
"pyrexc" look for the module instead.

* pyrex.m4: New macro to check Pyrex version.
* m4/Makefile.inc: Add to dist.
* configure.ac: Use macro to check for Pyrex >= 0.9.3.
* python-yasm/Makefile.inc: Run Python directly instead of pyrexc wrapper.

svn path=/trunk/yasm/; revision=1457

18 years agoHook Python module into the build (even though it's pretty incomplete),
Peter Johnson [Tue, 4 Apr 2006 06:07:32 +0000 (06:07 -0000)]
Hook Python module into the build (even though it's pretty incomplete),
enabled with --enable-python (defaults to auto-detect).

Thanks to some magic in python-yasm/Makefile.inc and setup.py, this actually
plays nicely with automake distcheck.

* m4/pythonhead.m4: Script to find Python.h.
* m4/Makefile.inc: Include it in distfiles.
* configure.ac: Add --enable-python option and Python and Pyrex detection.
* tools/Makefile.inc: Pull tools/python-yasm/Makefile.inc into build.
* python-yasm/Makefile.inc: Add automake build magic for extension.
* setup.py: Likewise.

svn path=/trunk/yasm/; revision=1456

18 years ago* bytecode.pxi: Fix definition of yasm_dv_create_string().
Peter Johnson [Tue, 4 Apr 2006 06:02:18 +0000 (06:02 -0000)]
* bytecode.pxi: Fix definition of yasm_dv_create_string().

svn path=/trunk/yasm/; revision=1455

18 years ago* dwarf2-dbgfmt.c, cv-symline.c, nasm-pp.c: Clean up a few unused variables.
Peter Johnson [Tue, 4 Apr 2006 03:46:18 +0000 (03:46 -0000)]
* dwarf2-dbgfmt.c, cv-symline.c, nasm-pp.c: Clean up a few unused variables.

svn path=/trunk/yasm/; revision=1454

18 years ago* value.pxi, expr.pxi: Copy instead of NULL'ing origin; this will look much
Peter Johnson [Mon, 3 Apr 2006 04:54:27 +0000 (04:54 -0000)]
* value.pxi, expr.pxi: Copy instead of NULL'ing origin; this will look much
more pythonic on the python side, although it will cause much additional
object churn, and will not be fast.

svn path=/trunk/yasm/; revision=1453

18 years ago* coretype.h (yasm_output_value_func): Remove splint reference to ep.
Peter Johnson [Mon, 3 Apr 2006 04:39:53 +0000 (04:39 -0000)]
* coretype.h (yasm_output_value_func): Remove splint reference to ep.

svn path=/trunk/yasm/; revision=1452