]> granicus.if.org Git - yasm/log
yasm
20 years agoNASM preprocessor's genmacro needs to built differently for cross-building.
Peter Johnson [Sat, 14 Aug 2004 23:49:29 +0000 (23:49 -0000)]
NASM preprocessor's genmacro needs to built differently for cross-building.

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

20 years agoUpdate auto*, libtool, libltdl, and gettext scripts.
Peter Johnson [Sat, 14 Aug 2004 23:07:58 +0000 (23:07 -0000)]
Update auto*, libtool, libltdl, and gettext scripts.
Make cross-building work by changing how re2c and other build tools are
compiled.

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

20 years agoChange from .cvsignore files to svn:ignore directory properties.
Peter Johnson [Sun, 8 Aug 2004 20:12:41 +0000 (20:12 -0000)]
Change from .cvsignore files to svn:ignore directory properties.

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

20 years agoRemove malloc function check; it can need a malloc.c, and thus breaks on
Peter Johnson [Mon, 5 Jul 2004 23:47:48 +0000 (23:47 -0000)]
Remove malloc function check; it can need a malloc.c, and thus breaks on
newer versions of autoconf/automake.

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

20 years agoFixed handling of absolute sections in the elf object format, including
Michael Urman [Fri, 28 May 2004 13:19:48 +0000 (13:19 -0000)]
Fixed handling of absolute sections in the elf object format, including
preventing a segfault.  The assumptions it had made for all sections
were wrong with absolute sections, so added just as much special casing
as necessary.  I hope the output is correct as well - this way we should
at least get bugs if it's wrong.

Reported by: Ben Skeggs <d4rk74m4@intas.net.au>

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

20 years agoAdd support for NASM-compatible ELF extensions to the GLOBAL and COMMON
Peter Johnson [Mon, 17 May 2004 04:20:52 +0000 (04:20 -0000)]
Add support for NASM-compatible ELF extensions to the GLOBAL and COMMON
directives.

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

20 years agoAdd flat Makefile for MINGW cross-compile to Win32.
Peter Johnson [Mon, 10 May 2004 05:39:03 +0000 (05:39 -0000)]
Add flat Makefile for MINGW cross-compile to Win32.

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

20 years agoAdd compile of libyasm/objfmt.c.
Peter Johnson [Mon, 10 May 2004 05:38:30 +0000 (05:38 -0000)]
Add compile of libyasm/objfmt.c.

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

20 years agosnprintf is not portable; use strcpy/strcat instead.
Peter Johnson [Mon, 10 May 2004 05:35:53 +0000 (05:35 -0000)]
snprintf is not portable; use strcpy/strcat instead.

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

20 years agoFix LSS opcode.
Peter Johnson [Tue, 4 May 2004 19:40:15 +0000 (19:40 -0000)]
Fix LSS opcode.

Bugzilla Bug: 36
Reported By: vclaudepierre@tiscali.fr

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

20 years agoAdd rudimentary, untested, AMD64 support.
Peter Johnson [Sun, 11 Apr 2004 23:25:17 +0000 (23:25 -0000)]
Add rudimentary, untested, AMD64 support.
The AMD64 MASM likes to generate REL32 relocations for everything; I've not
yet figured out how this works.
This code should work fine for files without relocation.

Bugzilla bug: 33
Reported by: Jeff Lawson <jlawson-yasm@bovine.net>

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

20 years agoPrevious commit broke build on non-CygWin. Fixed so it now works on both
Peter Johnson [Sat, 3 Apr 2004 19:35:48 +0000 (19:35 -0000)]
Previous commit broke build on non-CygWin.  Fixed so it now works on both
CygWin and non-CygWin machines.

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

20 years agoDisable checking for system-wide ARGZ functions; they're broken on CygWin
Peter Johnson [Sat, 3 Apr 2004 04:26:17 +0000 (04:26 -0000)]
Disable checking for system-wide ARGZ functions; they're broken on CygWin
at the minimum.

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

20 years agoAdd objfmt.c and assocdat.c to libyasm VC++ build.
Peter Johnson [Sat, 3 Apr 2004 03:05:39 +0000 (03:05 -0000)]
Add objfmt.c and assocdat.c to libyasm VC++ build.

Bugzilla bug: 32
Reported by: jlawson-yasm@bovine.net

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

20 years agoFix crash on cygwin due to large on-stack allocation.
Peter Johnson [Sat, 3 Apr 2004 01:25:01 +0000 (01:25 -0000)]
Fix crash on cygwin due to large on-stack allocation.

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

20 years agoInclude nasm-macros.c in the distribution by including it in SOURCES.
Peter Johnson [Sat, 3 Apr 2004 01:24:02 +0000 (01:24 -0000)]
Include nasm-macros.c in the distribution by including it in SOURCES.
This is primarily for users building yasm on Windows using VC++.

Bugzilla bug: 32
Reported by: jlawson-yasm@bovine.net

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

20 years agoActually include needed function replacements in the yasm link.
Peter Johnson [Sat, 3 Apr 2004 01:21:22 +0000 (01:21 -0000)]
Actually include needed function replacements in the yasm link.

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

20 years agoFix indexreg handling in x86_expr_checkea_getregusage() to correctly handle
Peter Johnson [Sat, 27 Mar 2004 03:14:52 +0000 (03:14 -0000)]
Fix indexreg handling in x86_expr_checkea_getregusage() to correctly handle
a non-multiplier used after a multiplier (e.g. edi*8+eax).  Previously,
this resulted in the eax overriding the edi as the indexreg, causing the
effective address not to be recognized.

Update the effaddr testcase to test this case and a few other similar ones.

Bugzilla bug: 31
Reported by: vclaudepierre@tiscali.fr

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

20 years agoFix push in 64-bit mode to take a 32-bit signed immediate rather than a
Peter Johnson [Tue, 16 Mar 2004 08:26:19 +0000 (08:26 -0000)]
Fix push in 64-bit mode to take a 32-bit signed immediate rather than a
64-bit immediate.  Actually, whether it's signed or unsigned seems to be
uncertain; AMD64 documentation shows it as signed, but Intel's new IA-32e
says it's unsigned!  While we're here, the Imm8 version is signed, not
unsigned.

Bugzilla bug: 30
Reported by: Michael Ryan <michaelryan@mindspring.com>

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

20 years agoConvert re2c cleanup.pl to cleanup.c, removing final Perl dependency.
Peter Johnson [Mon, 15 Mar 2004 05:18:07 +0000 (05:18 -0000)]
Convert re2c cleanup.pl to cleanup.c, removing final Perl dependency.
Remove checking for Perl and Perl version in configure.

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

20 years agoConvert NASM preproc macros.pl to genmacro.c, to remove a Perl
Peter Johnson [Mon, 15 Mar 2004 00:27:06 +0000 (00:27 -0000)]
Convert NASM preproc macros.pl to genmacro.c, to remove a Perl
dependency.

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

20 years agoConvert test_hd.pl to test_hd.c, to remove one Perl dependency.
Peter Johnson [Sun, 14 Mar 2004 22:25:18 +0000 (22:25 -0000)]
Convert test_hd.pl to test_hd.c, to remove one Perl dependency.

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

20 years agoComment "Op1Add is only used for FPU, so no need to do REX" is incorrect;
Peter Johnson [Tue, 9 Mar 2004 07:15:53 +0000 (07:15 -0000)]
Comment "Op1Add is only used for FPU, so no need to do REX" is incorrect;
BSWAP uses Op1Add!

Reported by: vclaudepierre@tiscali.fr
Bugzilla bug: 27

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

20 years agoFix handling of >32 bit NASM character constants; they were being shifted
Peter Johnson [Tue, 2 Mar 2004 05:53:30 +0000 (05:53 -0000)]
Fix handling of >32 bit NASM character constants; they were being shifted
an extra time.

Bugzilla bug: 25
Reported by: vclaudepierre@tiscali.fr

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

20 years agoActually include (newly added) basename.c and dirname.c in the distribution.
Peter Johnson [Sun, 8 Feb 2004 02:54:25 +0000 (02:54 -0000)]
Actually include (newly added) basename.c and dirname.c in the distribution.

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

20 years agoMake yasm dynamic module loader able to find modules even when run from a
Peter Johnson [Sat, 7 Feb 2004 22:28:40 +0000 (22:28 -0000)]
Make yasm dynamic module loader able to find modules even when run from a
different location.  The new code uses dirname() to add the argv[0] path to
the LTDL module loader search path.  Added new replacements for dirname and
basename functions from OpenBSD.

Bugzilla: Bug 24
Reported by: Simon Paulger <simonjpaulger@hotmail.com>

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

20 years agoMassive libyasm / module interface update - Phase 2 (finally).
Peter Johnson [Fri, 6 Feb 2004 21:12:56 +0000 (21:12 -0000)]
Massive libyasm / module interface update - Phase 2 (finally).

(Hopefully) finish cleanups begun in phase 1 (see phase 1 commit message),
making dbgfmt, objfmt, optimizer, and preproc module interfaces follow the
same thread-safe interface style as the phase 1 changes.

Also put in a large number of doxygen documentation cleanups.

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

20 years agoInstall assocdat.h along with the other headers.
Peter Johnson [Fri, 6 Feb 2004 21:08:53 +0000 (21:08 -0000)]
Install assocdat.h along with the other headers.

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

20 years agoAdd assocdat.o to flat Makefiles; the VC++ ones will need to be fixed later.
Peter Johnson [Fri, 6 Feb 2004 21:06:34 +0000 (21:06 -0000)]
Add assocdat.o to flat Makefiles; the VC++ ones will need to be fixed later.

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

20 years agoCorrect ordering of legacy prefix and REX prefix for SSE/SSE2 instructions
Peter Johnson [Thu, 5 Feb 2004 08:25:20 +0000 (08:25 -0000)]
Correct ordering of legacy prefix and REX prefix for SSE/SSE2 instructions
in 64-bit (AMD64) mode.  Intel says these bytes should not be treated as
prefixes, but AMD64 treats them as legacy prefixes, expecting them to come
before the REX byte.

For now, keep the three-byte max instruction length (although it's not truly
correct), as handling the other "3-byte" cases such as R/M spare with no EA
is probably more painful than it's worth to push down to later in the code
generation path.

Reported by: Henryk Richter <henryk.richter@comlab.uni-rostock.de>

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

20 years agoFix SIMD VR/PR instruction encoding for the following instructions:
Peter Johnson [Thu, 5 Feb 2004 03:40:16 +0000 (03:40 -0000)]
Fix SIMD VR/PR instruction encoding for the following instructions:
 - PEXTRW
 - MOVMSKPD
 - MOVMSKPS
 - PMOVMSKB
Reported by: Vivek Mohan <vivekm@phreaker.net>

Also, while we're here, fix all CVT* SIMD instructions; they were variously
incorrect (mostly with regards to accepted operands).

New testcase, simd-2, tests all the above (output verified with GNU objdump).

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

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