]> granicus.if.org Git - yasm/log
yasm
21 years agoDelete the output file on error.
Peter Johnson [Fri, 2 Jan 2004 23:57:15 +0000 (23:57 -0000)]
Delete the output file on error.
Bugzilla bug #23

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

21 years agoAdd VC++ 7.1 build files to the distribution.
Peter Johnson [Fri, 26 Dec 2003 08:01:34 +0000 (08:01 -0000)]
Add VC++ 7.1 build files to the distribution.

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

21 years agoAdd VC build files for VC++ 7.1 (untested by myself).
Peter Johnson [Fri, 26 Dec 2003 07:58:02 +0000 (07:58 -0000)]
Add VC build files for VC++ 7.1 (untested by myself).
Currently requires Perl installed as \Program Files\Perl\bin\perl.

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

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

21 years agoAdd command line option (-X) to allow error reporting in the VC IDE format.
Peter Johnson [Fri, 26 Dec 2003 07:53:16 +0000 (07:53 -0000)]
Add command line option (-X) to allow error reporting in the VC IDE format.

Original patch submitted by: Brian Gladman <brg@gladman.plus.com>

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

21 years agoBring non-libtool (VC++) build up to date with libyasm structural changes.
Peter Johnson [Fri, 26 Dec 2003 04:53:44 +0000 (04:53 -0000)]
Bring non-libtool (VC++) build up to date with libyasm structural changes.

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

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

21 years agoAdd a workaround for the lack of per-objfmt macro support to fix the common
Peter Johnson [Tue, 16 Dec 2003 07:45:04 +0000 (07:45 -0000)]
Add a workaround for the lack of per-objfmt macro support to fix the common
use of the ORG macro (several user comments about the lack of this) and the
initial value of the __SECT__ macro (used by ENDSTRUC among other macros).
Fortunately, for all current objfmts, __SECT__ is currently defined as
[section .text], so one common definition can be used for now.

FIXME: remove this workaround when a better solution has been implemented.

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

21 years agoProperly handle fatal errors (like missing include file) from the real
Peter Johnson [Tue, 16 Dec 2003 03:54:15 +0000 (03:54 -0000)]
Properly handle fatal errors (like missing include file) from the real
NASM parser by changing the libyasm yasm_fatal() interface to use va_list
instead of ... variable arguments.  Add a yasm__fatal() function that takes
... and calls yasm_fatal().

Bugzilla bug #22
Reported by: mu@tortall.net

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

21 years agoEnable elf support for extended section attribute align=foo parameters.
Michael Urman [Tue, 2 Dec 2003 06:27:53 +0000 (06:27 -0000)]
Enable elf support for extended section attribute align=foo parameters.
It had previously been mysteriously if(0)'d out.

Reported By: Edouard Gomez <ed.gomez@free.fr>

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

21 years agoFix stabs to always use stab size 12, n_value size 4. Truncate 64bit
Michael Urman [Tue, 4 Nov 2003 20:05:50 +0000 (20:05 -0000)]
Fix stabs to always use stab size 12, n_value size 4.  Truncate 64bit
values into 32bits as necessary.  This is the proper fix to "written
length does not match optimized length" in amd64+stabs.

Reported by Jeff Lawson <jlawson-yasm@bovine.net>

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

21 years ago"Fix" stabs to always output the same stab length in stabs_bc_stab_tobytes.
Michael Urman [Tue, 4 Nov 2003 19:52:02 +0000 (19:52 -0000)]
"Fix" stabs to always output the same stab length in stabs_bc_stab_tobytes.
Previously only "symvalue" stabs did this, causing a mismatched output size
with amd64 and stabs.  However since it appears the actual stabs spec always
uses 12 byte stabs, this fix is already obsolete and will be superceded
shortly.

Reported By: Jeff Lawson <jlawson-yasm@bovine.net>

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

21 years agoFix macro definitions of yasm_arch_module_version() and
Peter Johnson [Thu, 30 Oct 2003 19:21:59 +0000 (19:21 -0000)]
Fix macro definitions of yasm_arch_module_version() and
yasm_arch_module_def_machine().

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

21 years agoRemove extraneous printf("DBG: ")
Michael Urman [Tue, 28 Oct 2003 19:18:47 +0000 (19:18 -0000)]
Remove extraneous printf("DBG: ")

Reported By: Edouard Gomez <ed.gomez@free.fr>

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

21 years agoHide details of yasm_arch_module structure, instead creating wrapper macro
Peter Johnson [Tue, 28 Oct 2003 18:58:55 +0000 (18:58 -0000)]
Hide details of yasm_arch_module structure, instead creating wrapper macro
"functions" that call down to the module level.  Doesn't really change the
internal complexities, just makes it easier to read and write code that
uses it.

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

21 years agoFix expression handling of unary NOT (~ in nasm syntax) operator.
Peter Johnson [Sun, 26 Oct 2003 02:34:29 +0000 (02:34 -0000)]
Fix expression handling of unary NOT (~ in nasm syntax) operator.

Reported by: Edouard Gomez <ed.gomez@free.fr>

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

21 years agoAllow colons for EQU labels (e.g. "value: equ 5").
Peter Johnson [Sun, 26 Oct 2003 02:04:47 +0000 (02:04 -0000)]
Allow colons for EQU labels (e.g. "value: equ 5").

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

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

21 years agoFix [ebp+index*reg] code generation (the immediate is required even with
Peter Johnson [Sun, 26 Oct 2003 01:56:00 +0000 (01:56 -0000)]
Fix [ebp+index*reg] code generation (the immediate is required even with
an index reg).

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

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

21 years agoFix pshift instructions by fixing meaning of MOD_Gap0 to actually eat the
Peter Johnson [Fri, 24 Oct 2003 01:32:22 +0000 (01:32 -0000)]
Fix pshift instructions by fixing meaning of MOD_Gap0 to actually eat the
first parameter (before MOD_Op2Add).  Before this change, MOD_Gap0 did not
eat a parameter until AFTER MOD_Op2Add.

Reported by: Edouard Gomez <ed.gomez@free.fr>

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

21 years agoFix encoding of repe and repz prefixes.
Peter Johnson [Thu, 23 Oct 2003 01:19:15 +0000 (01:19 -0000)]
Fix encoding of repe and repz prefixes.
Reported by: Edouard Gomez <ed.gomez@free.fr>

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

21 years agoFix reporting of redefinition errors by adding a set of error/warning
Peter Johnson [Tue, 21 Oct 2003 03:04:56 +0000 (03:04 -0000)]
Fix reporting of redefinition errors by adding a set of error/warning
reporting functions that take a parameter for the line to be displayed in
addition to the the line used for sorting.  This allows the "previously
defined" message to use the standard errwarn line resolution functions.

The resulting error messages look like gcc output.

Reported by: Edouard Gomez <ed.gomez@free.fr>

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

21 years agoBe less pedantic about trailing commas in data declarations and incbin.
Peter Johnson [Tue, 21 Oct 2003 01:54:31 +0000 (01:54 -0000)]
Be less pedantic about trailing commas in data declarations and incbin.
We're still being pedantic when it comes to instructions, however.

Reported by: Edouard Gomez <ed.gomez@free.fr>

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

21 years agoFix a couple of MMX/SSE/SSE2 instructions: movntps, movntq, movss, and the
Peter Johnson [Tue, 21 Oct 2003 01:36:19 +0000 (01:36 -0000)]
Fix a couple of MMX/SSE/SSE2 instructions: movntps, movntq, movss, and the
pcmp* family.  The first three had some operand encoding problems, and pcmp*
was typoed as pacmp*.
Reported by: Edouard Gomez <ed.gomez@free.fr>

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

21 years agoRemove obsolete overflow check in EA displacements (causing error instead of
Peter Johnson [Sun, 19 Oct 2003 18:38:03 +0000 (18:38 -0000)]
Remove obsolete overflow check in EA displacements (causing error instead of
warning on size overflow).
Bugzilla Bug 18
Reported by Jeff Lawson <jlawson-yasm@bovine.net>

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

21 years agoAdd support for nasm-inherited command line options -D and -U.
Michael Urman [Sun, 19 Oct 2003 18:11:29 +0000 (18:11 -0000)]
Add support for nasm-inherited command line options -D and -U.
Unify option storage for cleanliness and to maintain command line PIDU order.

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

21 years agoConstify args to pp_include_path() and pp_pre_include().
Peter Johnson [Sun, 19 Oct 2003 16:56:16 +0000 (16:56 -0000)]
Constify args to pp_include_path() and pp_pre_include().

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

21 years agoFix copy-and-paste error causing xmm9-xmm15 to be unusable.
Peter Johnson [Sat, 18 Oct 2003 01:48:46 +0000 (01:48 -0000)]
Fix copy-and-paste error causing xmm9-xmm15 to be unusable.
Bugzilla Bug 16
Reported by: Igor Astakhov <asigor@stl.sarov.ru>

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

21 years agoUnconst-ify declarations of yasm_arch_module and yasm_parser_module in
Peter Johnson [Sat, 18 Oct 2003 01:18:54 +0000 (01:18 -0000)]
Unconst-ify declarations of yasm_arch_module and yasm_parser_module in
modules; when declared const, it breaks libtool visibility of the symbols!

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

21 years agoConst-ify yasm_arch_module and yasm_parser_module usage.
Peter Johnson [Mon, 6 Oct 2003 00:23:31 +0000 (00:23 -0000)]
Const-ify yasm_arch_module and yasm_parser_module usage.
Hide yasm_arch implementation behind YASM_LIB_INTERNAL.

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

21 years agoMore cleanly implement size overrides (based on arch word size).
Peter Johnson [Sun, 5 Oct 2003 23:29:04 +0000 (23:29 -0000)]
More cleanly implement size overrides (based on arch word size).

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

21 years agoMerge in NASM CVS changes up to 10/02/2003. Changes NOT merged:
Peter Johnson [Fri, 3 Oct 2003 00:32:40 +0000 (00:32 -0000)]
Merge in NASM CVS changes up to 10/02/2003.  Changes NOT merged:
 - Removal of backslash() - why was this okay?
 - Addition of pp_get_include_path_ptr() - we (will eventually) do this a
   different way in yasm.

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

21 years agoAdd check specifically for Bison and for Bison version >= 1.25.
Peter Johnson [Thu, 2 Oct 2003 21:55:58 +0000 (21:55 -0000)]
Add check specifically for Bison and for Bison version >= 1.25.

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

21 years agoMake parser a Bison pure_parser; this makes it thread-safe and possibly
Peter Johnson [Thu, 2 Oct 2003 21:30:23 +0000 (21:30 -0000)]
Make parser a Bison pure_parser; this makes it thread-safe and possibly
more portable across older Bison versions.

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

21 years agoyasm_section_print(): Fix incorrect number of args being given to printf().
Peter Johnson [Thu, 2 Oct 2003 21:05:08 +0000 (21:05 -0000)]
yasm_section_print(): Fix incorrect number of args being given to printf().

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

21 years agoMassive libyasm / module interface update - Phase 1
Peter Johnson [Thu, 2 Oct 2003 05:03:50 +0000 (05:03 -0000)]
Massive libyasm / module interface update - Phase 1

As yasm has evolved, various minor additions have been made to libyasm to
support the new features.  These minor additions have accumulated, and
some contain significant redundancies.  In addition, the core focus of
yasm has begun to move away from the front-end commandline program "yasm"
to focusing on libyasm, a collection of reusable routines for use in all
sorts of programs dealing with code at the assembly level, and the modules
that provide specific features for parsing such code.

This libyasm/module update focuses on cleaning up much of the cruft that
has accumulated in libyasm, standardizing function names, eliminating
redundancies, making many of the core objects more reusable for future
extensions, and starting to make libyasm and the modules thread-safe by
eliminating static variables.

Specific changes include:
 - Making a symbol table data structure (no longer global).  It follows a
   factory model for creating symrecs.
 - Label symbols now refer only to bytecodes; bytecodes have a pointer to
   their containing section.
 - Standardizing on *_create() and *_destroy() for allocation/deallocation.
 - Adding a standardized callback mechanism for all data structures that
   allow associated data.  Allowed the removal of objfmt and
   dbgfmt-specific data callbacks in their interfaces.
 - Unmodularizing linemgr, but allowing multiple linemap instances (linemgr
   is now renamed linemap).
 - Remove references to lindex; all virtual lines (from linemap) are now
   just "line"s.
 - Eliminating the bytecode "type" enum, instead adding a standardized
   callback mechanism for custom (and standard internal) bytecode types.
   This will make it much easier to add new bytecodes, and eliminate the
   possibility of type collisions.  This also allowed the removal of the
   of_data and df_data bytecodes, as objfmts and dbgfmts can now easily
   implement their own bytecodes, and the cleanup of arch's bytecode usage.
 - Remove the bytecodehead and sectionhead pseudo-containers, instead
   making true containers: section now implements all the functions of
   bytecodehead, and the new object data structure implements all the
   functions of sectionhead.
 - Add object data structure: it's a container that contains sections, a
   symbol table, and a line mapping for a single object.  Every former use
   of sectionhead now takes an object.
 - Make arch interface and all standard architectures thread-safe:
   yasm_arch_module is the module interface; it contains a create()
   function that returns a yasm_arch * to store local yasm_arch data; all
   yasm_arch_module functions take the yasm_arch *.
 - Make nasm parser thread-safe.

To be done in phase 2: making other module interfaces thread-safe.  Note
that while the module interface may be thread-safe, not all modules may be
written in such a fashion (hopefully all the "standard" ones will be, but
this is yet to be determined).

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

21 years agoSeparate decrement and nasm_free() call; with dmalloc enabled, nasm_free()
Peter Johnson [Thu, 2 Oct 2003 03:53:53 +0000 (03:53 -0000)]
Separate decrement and nasm_free() call; with dmalloc enabled, nasm_free()
is a macro (in the yasm version) that uses the passed pointer twice.

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

21 years agoMerge updates for 0.3.0 into the trunk (except for version bump).
Peter Johnson [Fri, 5 Sep 2003 04:20:46 +0000 (04:20 -0000)]
Merge updates for 0.3.0 into the trunk (except for version bump).

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

21 years agoFix support for o64. AMD64 isn't always 32-bit default operand size, so
Peter Johnson [Fri, 5 Sep 2003 00:39:15 +0000 (00:39 -0000)]
Fix support for o64.  AMD64 isn't always 32-bit default operand size, so
add fields to bytecode and parsing insn_info to determine default operand
size in 64-bit mode.

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

21 years agoFix usage of 32-bit "high" registers (such as r8d) in memory expressions in
Peter Johnson [Sun, 31 Aug 2003 20:24:05 +0000 (20:24 -0000)]
Fix usage of 32-bit "high" registers (such as r8d) in memory expressions in
64-bit mode.  Reported by: Jean-Daniel Gooyert <jdgooyert@hotmail.com>.

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

21 years agoFix doxygen comment for yasm_bc_tobytes().
Peter Johnson [Wed, 20 Aug 2003 05:28:05 +0000 (05:28 -0000)]
Fix doxygen comment for yasm_bc_tobytes().

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

21 years agoFix for Perl 5.8.0 in UTF-8 locales.
Peter Johnson [Sat, 16 Aug 2003 05:37:23 +0000 (05:37 -0000)]
Fix for Perl 5.8.0 in UTF-8 locales.

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

21 years agoFix up license text to closely match COPYING. It's ugly, but it's more
Peter Johnson [Fri, 15 Aug 2003 04:17:06 +0000 (04:17 -0000)]
Fix up license text to closely match COPYING.  It's ugly, but it's more
accurate.

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

21 years agoNote that the artistic license only applies to bitvect's usage.
Peter Johnson [Fri, 15 Aug 2003 04:16:02 +0000 (04:16 -0000)]
Note that the artistic license only applies to bitvect's usage.

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

21 years agoRemove some useless PASS1 comments, and clean up spacing. Cosmetic only.
Michael Urman [Fri, 15 Aug 2003 03:50:33 +0000 (03:50 -0000)]
Remove some useless PASS1 comments, and clean up spacing.  Cosmetic only.

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

21 years agoSTABS debugging information. This includes, naturally, several draft
Michael Urman [Fri, 15 Aug 2003 03:43:55 +0000 (03:43 -0000)]
STABS debugging information.  This includes, naturally, several draft
changes to the dbgfmt interface, and other assorted updates, including:
* yasm.c now calls df->initialize() and df->generate()
* a dbgfmt bytecode type with associated handling
* yasm_output_reloc_func type for use particularly by dbgfmts
* df: initialize updated; generate, bc_dbgfmt_data_{output|delete|print} added
* null-dbgfmt structure brought in line with these additions
* elf-objfmt made aware of stabs sections, and what to do with them

The bad news:
* just enough stabs output to support line number information in GDB
* GDB identifies function labels off by 3 bytes in my test, but line
  numbers remain correct, somehow.  Unknown whether stabs-dbgfmt or GDB
  at fault.

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

21 years agoRepeat after me: test compile before commit.
Peter Johnson [Fri, 15 Aug 2003 03:40:53 +0000 (03:40 -0000)]
Repeat after me: test compile before commit.
Side note: there's a bug in cleanup.pl; it mistakenly deleted the yyaccept
when it shouldn't have.

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

21 years agoScanner internal to re2c was not catching EOF's properly.
Peter Johnson [Fri, 15 Aug 2003 03:35:17 +0000 (03:35 -0000)]
Scanner internal to re2c was not catching EOF's properly.

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

21 years agoAdd word size to arch module interface for better support of future archs which
Peter Johnson [Thu, 14 Aug 2003 03:25:44 +0000 (03:25 -0000)]
Add word size to arch module interface for better support of future archs which
have a "word" size != 2.

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

21 years agoBring up to date with many source tree changes.
Peter Johnson [Tue, 5 Aug 2003 04:16:02 +0000 (04:16 -0000)]
Bring up to date with many source tree changes.

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

21 years agoAdd support for the AMD64 syntax [symbol wrt rip]. This is distinct from
Peter Johnson [Sun, 3 Aug 2003 21:13:20 +0000 (21:13 -0000)]
Add support for the AMD64 syntax [symbol wrt rip].  This is distinct from
[rip+symbol] in that the latter adds the symbol offset to rip, whereas the
former is the same as [symbol] but uses rip-relative addressing.  This is
a minor overload of the WRT operator, but reads well and shouldn't conflict
with the use of WRT against sections.

Doing this currently adds a bit of overhead to all effective addresses in
64-bit mode (a $ symbol reference).  This is the cleanest approach I could
figure out; a time/space trade could be made later, such as prescanning for
RIP usage before allocating the symbol.

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

21 years agoAdd yasm_expr_extract_wrt() to separate portions of WRT expression.
Peter Johnson [Sun, 3 Aug 2003 21:06:15 +0000 (21:06 -0000)]
Add yasm_expr_extract_wrt() to separate portions of WRT expression.

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

21 years agoELF objfmt size agnosticism:
Michael Urman [Sun, 3 Aug 2003 01:13:14 +0000 (01:13 -0000)]
ELF objfmt size agnosticism:
* Replace ulongs secthead.size, secthead.align, reloc.addr with intnums
* Calculate relocation size with intnums
* Create macros YASM_WRITE_32I_L, YASM_WRITE_64I_L to write 32/64bit
  intnums to buffer
This doesn't quite cover everything, particularly due to various calls
to yasm_intnum_get_uint for various bits of processing, but it's close!

Miscellany:
* Fix non-call to elf_reloc_delete()
* Remove unused secthead.addr, secthead_set_addr
* Create macro YASM_WRITE_64Z_L to write zero-extended 32bit value to
  64bits of buffer

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

21 years agoMove elf relocation valsize handling to the backend.
Michael Urman [Sat, 2 Aug 2003 21:50:42 +0000 (21:50 -0000)]
Move elf relocation valsize handling to the backend.
Add elf x86 test case to verify it works properly.
Unsure about elf x86-64 status (relocations segfault my objdump), but
 it's no *worse* than last commit.

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

21 years agoContinue adding AMD64 ELF support (without breaking x86!):
Michael Urman [Sat, 2 Aug 2003 20:32:42 +0000 (20:32 -0000)]
Continue adding AMD64 ELF support (without breaking x86!):
Move more machine-specific items to the backend (EHDR_SIZE) and make it
 target machine-dependent there.
Theoretically everything except relocations may work, but since builds
 of amd64 with bits=32 can segfault objdump, don't trust it.
Work to support relocations is next; perhaps then it can be tested.

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

21 years agoFix parsing of WRT operator (it takes two operands, not one).
Peter Johnson [Sat, 2 Aug 2003 19:46:22 +0000 (19:46 -0000)]
Fix parsing of WRT operator (it takes two operands, not one).

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

21 years agoAdd Elf64 constants to elf.h
Michael Urman [Sat, 2 Aug 2003 17:45:53 +0000 (17:45 -0000)]
Add Elf64 constants to elf.h
Add elf_set_arch function to tell elf backend the machine, allow to deny.
Move arch/machine checking into backend.

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

21 years agoHide 386-specific constants from non-internal use.
Michael Urman [Sat, 2 Aug 2003 17:23:48 +0000 (17:23 -0000)]
Hide 386-specific constants from non-internal use.
Change interface of elf_reloc_entry_new() to allow this.

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

21 years agoImplement global constants in elf. Add test to ensure they work; modify
Michael Urman [Sat, 2 Aug 2003 03:43:41 +0000 (03:43 -0000)]
Implement global constants in elf.  Add test to ensure they work; modify
another test such that linked together they verify that
1. It links properly
2. The constant is loaded properly
3. The function is called properly
shown (probably not proved) by the program exiting with error level 0.

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

21 years agoActually use provided relocation type, instead of feeble-minded guessing.
Michael Urman [Sat, 2 Aug 2003 03:31:13 +0000 (03:31 -0000)]
Actually use provided relocation type, instead of feeble-minded guessing.
Add test case that centers on relocations; update test case that uses them.

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

21 years agoFix iretq, stosq, etc, which were properly setting the opersize but the REX
Peter Johnson [Fri, 1 Aug 2003 03:52:35 +0000 (03:52 -0000)]
Fix iretq, stosq, etc, which were properly setting the opersize but the REX
generation code wasn't seeing it because it wasn't looking at the modified
opersize.

Bug noticed by: Antoine Leca <antoine64leca@unknown> (x86-64 discuss ML)

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

21 years agoAdd versioning to all loadable module interfaces. The version is checked by
Peter Johnson [Wed, 30 Jul 2003 04:36:29 +0000 (04:36 -0000)]
Add versioning to all loadable module interfaces.  The version is checked by
module users to ensure the module interface they're using matches the
interface the module was compiled with.  The #define YASM_module_VERSION
should be incremented on every functional change to the module interface.

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

21 years agoAdd core pieces for "machine" subtype of "architecture". Needed to
Peter Johnson [Tue, 29 Jul 2003 03:19:12 +0000 (03:19 -0000)]
Add core pieces for "machine" subtype of "architecture".  Needed to
differentiate e.g. AMD64 from x86.  Doesn't prohibit anything in x86 yet,
but does standardize unsupported warnings across objfmts (most objfmts will
not support all machines and/or all architectures).

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

21 years agoRemove check for lex/flex; we no longer have any lex files.
Peter Johnson [Sat, 26 Jul 2003 03:49:57 +0000 (03:49 -0000)]
Remove check for lex/flex; we no longer have any lex files.

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

21 years agoFixed some conversion warnings caused by intnum commit. Missed these due to
Peter Johnson [Sat, 26 Jul 2003 02:32:04 +0000 (02:32 -0000)]
Fixed some conversion warnings caused by intnum commit.  Missed these due to
use of configure.ac's --enable-warnerror, which was set up to disable
conversion errors due to flex's warning-prone generated code.  As we no
longer use flex, fix configure.ac to not disable conversion errors.

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

21 years agoBig output_expr(), intnum_tobytes(), and floatnum_tobytes() changes:
Peter Johnson [Fri, 25 Jul 2003 03:27:21 +0000 (03:27 -0000)]
Big output_expr(), intnum_tobytes(), and floatnum_tobytes() changes:
 - Switch to bit-based output, including shift capability
 - This means the standard intnum output functions can be used for non-byte
   oriented archs like LC-3b (implemented)
 - Default out of range (overflow) warnings for intnum (bugzilla bug 14)
 - Change floating point overflow/underflow errors to warnings
To do (hooks but not implemented):
 - Shifting floatnums into destination
 - Floatnum destinations larger than floatnum value
 - Big endian support for intnum and floatnum
Related simultaneous changes:
 - Use bc instead of ep in objfmt output_expr() functions; while bc->line
   should == (*ep)->line, in case they differ, we want to use the bc->line
   so as not to confuse users.
 - lc3b-mp22NC test was not properly offsetting the accessed variables, but
   since the variable "sections" started at an aligned offset, the output
   was actually correct.  The new intnum warnings uncovered this issue, so
   fix code to be correct (and not generate warnings).

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

21 years agoWhen changing a section start into a start-based expression, use the
Peter Johnson [Fri, 25 Jul 2003 02:17:30 +0000 (02:17 -0000)]
When changing a section start into a start-based expression, use the
expression line number instead of the start line number (which may be 0,
which isn't nearly as useful as the expression line number).

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

21 years agoReplace preliminary elf header files with...
Michael Urman [Thu, 24 Jul 2003 04:38:37 +0000 (04:38 -0000)]
Replace preliminary elf header files with...

ELF objfmt implementation.

Assumed to be correct for the test cases, but only tested as far as feasible.
Currently only implements 32bit 386 little-endian, but is mostly abstracted
well enough to easily add more machines.

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

21 years agoActually return the basename from our basename() replacement.
Peter Johnson [Wed, 23 Jul 2003 02:48:13 +0000 (02:48 -0000)]
Actually return the basename from our basename() replacement.

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

21 years agoEnhance return values for yasm_x86__expr_checkea() to fully represent the
Peter Johnson [Sat, 19 Jul 2003 17:53:34 +0000 (17:53 -0000)]
Enhance return values for yasm_x86__expr_checkea() to fully represent the
three possible return states (okay, invalid, or indeterminate).  Propagate
this return change into the yasm_x86__expr_checkea() call tree as necessary.

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

21 years agoFix bad assumption in x86_expr_checkea_getregusage() that was causing bad code,
Peter Johnson [Sat, 19 Jul 2003 17:28:10 +0000 (17:28 -0000)]
Fix bad assumption in x86_expr_checkea_getregusage() that was causing bad code,
internal errors, and mis-optimization as seen in Bugzilla Bug 13.
Reported by: meor@softhome.net

Fix a few minor bugs (not heavily tested) due to use of opersize == 32 as a
comparison; this fails when opersize == 64 due to bits = 64, but the default
size is still 4 bytes, not 2.

There's still a couple cases here where we might end up with internal errors
due to a lack of variety in return values; I'll fix those in the next commit.

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

21 years agoCall/jmp far immediate single-byte instructions are invalid in 64-bit mode.
Peter Johnson [Sat, 19 Jul 2003 16:51:38 +0000 (16:51 -0000)]
Call/jmp far immediate single-byte instructions are invalid in 64-bit mode.

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

21 years agoyasm_intnum_is_zero(), yasm_intnum_is_pos1(): Don't need to check if bitvect,
Peter Johnson [Thu, 17 Jul 2003 02:25:25 +0000 (02:25 -0000)]
yasm_intnum_is_zero(), yasm_intnum_is_pos1(): Don't need to check if bitvect,
all <32 bit positive numbers are collapsed into ul form.
yasm_intnum_is_neg1(): fix bug which would equate 0xffffffff as -1.

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

21 years agoFix bug in edge case of expr_level_op(): single intnum in expression with
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++.

Bugzilla: #12.
Reported by: meor@softhome.net

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

21 years agoyasm_intnum_new_int(): Don't always create -1 intnums (oops)
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.

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

21 years agoUse /usr/bin/env for finding PERL.
Peter Johnson [Sun, 13 Jul 2003 21:32:29 +0000 (21:32 -0000)]
Use /usr/bin/env for finding PERL.

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

21 years agoFix RIP-relative effective addresses. They always have a 32-bit
Peter Johnson [Sat, 12 Jul 2003 22:55:22 +0000 (22:55 -0000)]
Fix RIP-relative effective addresses.  They always have a 32-bit
displacement.
Noticed by: Ben Skeggs <darktama@dodo.com.au>

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

21 years agoMake cpu_enabled a x86-local variable, and reset it in x86_initialize().
Peter Johnson [Sat, 12 Jul 2003 22:10:40 +0000 (22:10 -0000)]
Make cpu_enabled a x86-local variable, and reset it in x86_initialize().
Make CPU_* constants x86-local visible.

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

21 years agoAvoid warnings in strsep due to glibc's bits/string2.h string inlining by
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).

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

21 years agoIn floatnum_mul(), rename "exp" variable to "expon" to avoid compiler warning
Peter Johnson [Sat, 12 Jul 2003 17:55:04 +0000 (17:55 -0000)]
In floatnum_mul(), rename "exp" variable to "expon" to avoid compiler warning
(due to overriding global "exp" function).

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

21 years agoAdd sanity check for computed section size.
Peter Johnson [Sat, 12 Jul 2003 02:07:08 +0000 (02:07 -0000)]
Add sanity check for computed section size.

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

21 years agoCorrectly add in multiples (from TIMES operator) into section length.
Peter Johnson [Sat, 12 Jul 2003 01:58:37 +0000 (01:58 -0000)]
Correctly add in multiples (from TIMES operator) into section length.
Bugzilla #11
Reported by: meor@softhome.net

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

21 years agoRemove reference to yapp; it's been deleted.
Peter Johnson [Fri, 11 Jul 2003 05:42:26 +0000 (05:42 -0000)]
Remove reference to yapp; it's been deleted.

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

21 years agoRemove yapp. It's been disconnected from the build for some time, has
Peter Johnson [Fri, 11 Jul 2003 05:41:21 +0000 (05:41 -0000)]
Remove yapp.  It's been disconnected from the build for some time, has
started to bitrot, and mu@ says it needs rewriting from scratch.

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

21 years agoClarify licensing.
Peter Johnson [Fri, 11 Jul 2003 04:35:42 +0000 (04:35 -0000)]
Clarify licensing.

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

21 years agoNote bitvect is actually triple-licensed under the Artistic License, GPL,
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.

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

21 years agoAdd test for 64-bit ORG.
Peter Johnson [Fri, 11 Jul 2003 03:10:44 +0000 (03:10 -0000)]
Add test for 64-bit ORG.

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

21 years agoRevamp intnum internals:
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.

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

21 years agoBitVector_add() and BitVector_sub() take a *carry parameter as an input; we
Peter Johnson [Fri, 11 Jul 2003 02:57:52 +0000 (02:57 -0000)]
BitVector_add() and BitVector_sub() take a *carry parameter as an input; we
were passing it uninitialized.

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

21 years agoBitVector_compute(), BitVector_add(), and BitVector_sub() carry parameter is
Peter Johnson [Fri, 11 Jul 2003 02:54:11 +0000 (02:54 -0000)]
BitVector_compute(), BitVector_add(), and BitVector_sub() carry parameter is
both a carry in AND a carry out.

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

21 years agoFix bts/btr immediate operands (previously required "byte" specifier).
Peter Johnson [Fri, 11 Jul 2003 02:18:01 +0000 (02:18 -0000)]
Fix bts/btr immediate operands (previously required "byte" specifier).

Bugzilla #10
Reported by: meor@softhome.net

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

21 years agoBUGFIX: In yasm_intnum_calc(), use operand->val.bv instead of acc->val.bv if
Peter Johnson [Thu, 10 Jul 2003 04:54:55 +0000 (04:54 -0000)]
BUGFIX: In yasm_intnum_calc(), use operand->val.bv instead of acc->val.bv if
the operand is already a bitvector.

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

21 years agoAllow complex (expression) section starts, primarily used for implementation
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.

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

21 years agoAdd a \warning that yasm_vps_delete() deletes all val/params.
Peter Johnson [Tue, 8 Jul 2003 02:51:39 +0000 (02:51 -0000)]
Add a \warning that yasm_vps_delete() deletes all val/params.

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

21 years agoDocument for Doxygen (comment-only changes).
Peter Johnson [Tue, 8 Jul 2003 02:50:29 +0000 (02:50 -0000)]
Document for Doxygen (comment-only changes).

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

21 years agoFix return comment for parse_directive(). Nonzero is returned if a directive
Peter Johnson [Sun, 29 Jun 2003 19:23:28 +0000 (19:23 -0000)]
Fix return comment for parse_directive().  Nonzero is returned if a directive
is NOT recognized.

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

21 years agoComment for Doxygen.
Peter Johnson [Sat, 28 Jun 2003 17:39:58 +0000 (17:39 -0000)]
Comment for Doxygen.

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

21 years agoAdd \rcs, \endrcs, \license, and \endlicense wrappers around $IdPath$ and
Peter Johnson [Sat, 28 Jun 2003 17:38:08 +0000 (17:38 -0000)]
Add \rcs, \endrcs, \license, and \endlicense wrappers around $IdPath$ and
copyright/license portions to shorten Doxygen output.  Comment only change.

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

21 years agoFix a few Doxygen documentation comments and cross-references. Comment only
Peter Johnson [Sat, 28 Jun 2003 17:35:57 +0000 (17:35 -0000)]
Fix a few Doxygen documentation comments and cross-references.  Comment only
changes.

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

21 years agoDoxygen comment-only change: \caution does not exist, use \attention instead.
Peter Johnson [Wed, 25 Jun 2003 07:17:05 +0000 (07:17 -0000)]
Doxygen comment-only change: \caution does not exist, use \attention instead.

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

21 years agoFix bug in HAMT_insert() found by compiler-generated assembler file (lots of
Peter Johnson [Tue, 24 Jun 2003 08:05:33 +0000 (08:05 -0000)]
Fix bug in HAMT_insert() found by compiler-generated assembler file (lots of
similar label names).

Test also found a bug in COFF parsing of section options; this will be fixed
and a separate test added explicitly for it.

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

21 years agoFix twobytemem (two byte memory accessing, no size) opcodes.
Peter Johnson [Fri, 13 Jun 2003 02:34:40 +0000 (02:34 -0000)]
Fix twobytemem (two byte memory accessing, no size) opcodes.
Add testcase to check them.
Found and patched by: Ben Skeggs <darktama@dodo.com.au>

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

21 years agoPrevious commit didn't notationally separate x86 from AMD64 very well; be
Peter Johnson [Wed, 11 Jun 2003 02:55:08 +0000 (02:55 -0000)]
Previous commit didn't notationally separate x86 from AMD64 very well; be
more clear.

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