rather than simply taking a list of modules on the command line. This allows significant
improvement of the behavior when used with Visual Studio, as the "old" way of doing this
with Visual Studio build files was to scan through the .c files; this brought up things
that were actually disabled in the build.
Also incorporate a patch by Charles Bailey to make the VC8 build less noisy, and allow use
of Win32 Bison if it's installed. Instructions updated as well.
svn path=/trunk/yasm/; revision=1642
(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
* modules.vcproj: Remove PreBuildEvent pointing to build.bat that no longer
exists.
Contributed by: Brian Gladman <brg@gladman.plus.com>
svn path=/trunk/yasm/; revision=1441
handling. The new way of doing things follows C compiler standard path
searching rules in terms of relative and absolute paths in relation to
source location and the current working directory. There's probably some
latent bugs in this as I've not tested it on Windows yet.
This should make CodeView actually usable with included files.
* file.c (yasm__abspath_win, yasm__abspath_unix): Convert a relative path
into an absolute path. Code moved from:
* cv-symline.c (cv_make_pathname): Here (deleted).
(cv_dbgfmt_add_file): Use yasm__abspath() instead.
* file.h (yasm__abspath_win, yasm__abspath_unix): Prototype.
(yasm__abspath): Macro pointing to right version.
* file.c (yasm__combpath_win, yasm__combpath_unix): Combine two possibly
relative paths (also handles absolute paths).
* file.h (yasm__combpath_win, yasm__combpath_unix): Prototype.
(yasm__combpath): Macro pointing to right version.
* file.c (yasm__fopen_include): Where the new include search magic happens,
using yasm__combpath heavily.
* file.h (yasm__fopen_include): Prototype.
* nasm-preproc.c: Update to use yasm__fopen_include().
* nasmlib.c (nasm_src_get_fname): Helper.
* nasmlib.h (nasm_src_get_fname): Helper prototype.
* nasm-preproc.c (nasm_preproc_add_dep): Don't free pointer, we need it.
* splitpath_test.c: Update.
* combpath_test.c: New test for yasm__combpath_*.
* Mkfiles: Update config.h for yasm__abspath and yasm__combpath.
svn path=/trunk/yasm/; revision=1436
* md5.c, md5.h: Import MD5 from public domain version in CVS source.
* libyasm/Makefile.inc: Attach to libyasm build.
* libyasm.h: Include md5.h.
* coretype.h (yasm_value): Add new section_rel member.
* value.h (yasm_value_init, yasm_value_init_sym): Initialize.
* value.c (yasm_value_output_basic): Don't output if set.
* xdf-objfmt.c (xdf_objfmt_output_value): Likewise.
* elf-objfmt.c (elf_objfmt_output_value): Likewise.
* coff-objfmt.c (coff_objfmt_output_value): Generate SECREL for this.
* coretype.h (YASM_PATHSEP): New define for path separator.
* vc8/config.h, vc/config.h, dj/config.h: Override.
* dbgfmts/codeview: New, adds "cv8" dbgfmt.
* dbgfmts/Makefile.inc: Hook into build.
* coff-objfmt.c: Enable cv8 dbgfmt for win32 and win64. Change a few things
to more closely match MASM output.
(coff_section_data): Add isdebug flag so that section flags are set properly.
(coff_objfmt_secton_switch): Initialize to 0 here.
(coff_objfmt_init_remaining_section): Initialize to 1 and set various section
flags (DATA, DISCARD, READ) if section name starts with ".debug".
(coff_objfmt_output): If non-NULL dbgfmt, set object flags to say line numbers
are included.
* dwarfwin64_testhd.hex: Minor update due to coff_objfmt_output() change.
svn path=/trunk/yasm/; revision=1428
groundwork for further features and possible cleanups.
Note: this commit changes the way in which relocations in the
COFF/Win32/Win64 target can be forced to reference a different symbol than
is being pointed to; instead of the ambiguous "trap+(trap.end-trap)" to get
the reloc to point at trap.end but reference the trap symbol, after this
commit "trap.end wrt trap" is the way to say this. This also reads a lot
more clearly and is not ambiguous. This should really only affect people
who write .pdata sections for Win64. See the
objfmts/win64/tests/win64-dataref.asm testcase for an example of usage.
This cleanup adds a new data structure, yasm_value, which is used for all
expressions that can be potentially relocatable. This data structure
splits the absolute portion of the expression away from the relative
portion and any modifications to the relative portion (SEG, WRT,
PC-relative, etc). A large amount of code in the new value module breaks
a general expression into its absolute and relative parts
(yasm_value_finalize_expr) and provides a common set of code for writing
out non-relocated values (yasm_value_output_basic).
All bytecode handling in both libyasm and the architecture modules was
rewritten to use yasm_values when appropriate (e.g. data values,
immediates, and effective addresses). The yasm_output_expr_func is now
yasm_output_value_func and all users and implementors (mainly in object
formats) have been updated to handle yasm_values.
Simultaneously with this change, yasm_effaddr and yasm_immval full
structure definitions have been moved from bc-int.h to bytecode.h.
The data hiding provided by bc-int.h was relatively minimal and probably
overkill. Also, great simplifications have been made to x86 effective
address expression handling.
svn path=/trunk/yasm/; revision=1419
instead of re2c-generated code. This gives identifier recognition a
significant speedup and also drastically shortens compilation time of yasm
itself. This rewrite encouraged combining instruction and prefix
recognition into one function and register and target modifier
recognition into a second function (rather than having 5 or so separate
functions).
Also created a state in the NASM parser (as was done in the GAS parser),
so instructions/prefixes are only looked for until an instruction is
recognized. This avoids search time in the instructions hash for operands.
The tool used to generate the new identifier recognition is called GAP.
Someday we might extend this to generate more code than just the perfect
hash lookup.
* tools/gap: New tool to Generate Architecture Parser (aka perfect hashes).
* phash.c, phash.h: Helper functions used by GAP-generated code.
* x86id.re: Delete. Split into..
* x86parse.gap: Contains all identifier recognition portions.
* x86id.c: Contains instruction operand tables and code and higher-level
entry points into x86parse.gap perfect hash recognizers. Chose to flow
history of x86id.re into this file.
* arch.h: Combine instruction/prefix entry points and register/target
modifier entry points.
* lc3barch.c, lc3bid.re, lc3barch.h: Update to match.
* x86arch.c, x86arch.h: Update to match.
* Makefile.am, various Makefile.inc: Update.
* POTFILES.in: Update due to numerous file changes (not just this commit).
* Mkfiles: Update. VC build files untested at the moment.
svn path=/trunk/yasm/; revision=1395
The fix for this rippled into a lot of places, and I'm starting to see some
opportunities for cleaning up some of the object and objfmt structures.
* objfmt.h (yasm_objfmt_add_default_section): Move from standalone function
into objfmt-specific function.
(yasm_objfmt_module): Remove default_section_name string, and add objfmt
specific add_default_section function.
* yasm.c (main): Use slightly updated parameters when calling.
* section.h (yasm_section_is_default, yasm_section_set_default): New.
* section.c (yasm_section): Add def member (for default section flag).
(yasm_section_is_default, yasm_section_set_default): Implement.
* xdf-objfmt.c, bin-objfmt.c, dbg-objfmt.c, coff-objfmt.c: Implement.
Usually this required refactoring the objfmt-specific section data creation
into a separate function that could be used by both section_switch() and
the new add_default_section() functions, and changing section_switch() to
update changes to the section data if section was new or previously just a
default section, instead of the previous behavior of warning if the section
was not new.
* objfmt.c: Delete (no longer needed).
* Makefile.inc, Makefile.flat, libyasm.vcproj
Makefile.dj: Update to reflect removal.
* xdf-overdef.asm, win32-overdef.asm, elf-overdef.asm: Test.
svn path=/trunk/yasm/; revision=1390
Works for native Win32 builds, Win32->x64 cross builds, and native x64 builds.
Submitted by: Brian Gladman <brg@gladman.plus.com>
svn path=/trunk/yasm/; revision=1334
formats). This makes integration with the VC8 build tools much nicer, as
VC8 uses "x64" as the PlatformName environment setting.
* win64/Makefile.inc, Mkfiles/Makefile.flat, Mkfiles/Makefile.dj: Update
build files to look for objfmt_x64 module.
Suggested by: Brian Gladman <brg@gladman.plus.com>
svn path=/trunk/yasm/; revision=1331
* Mkfiles/vc8/config.h: Define _CRT_SECURE_NO_DEPRECATE to avoid most warnings about *_s functions.
Also use _stricmp directly instead of stricmp to avoid warnings.
* libyasm/strcasecmp.c: Support _stricmp usage.
* util.h: Likewise.
* tools/re2c/actions.c: Include ctype.h to define toupper/tolower.
* Mkfiles/vc8/modules/modules.vcproj: Don't include nasm-macros.c directly; this file is included
into another file and has no public variables.
* Mkfiles/vc8/yasm.sln: Allow x64 cross-builds from Win32 by building genmacro, genmodule, and
re2c for Win32 target.
svn path=/trunk/yasm/; revision=1328
Contributed by: Brian Gladman <brg@gladman.plus.com>
Also added a couple VC7 build files that were in the tree but missing from
EXTRA_DIST (and thus not included in the distribution).
svn path=/trunk/yasm/; revision=1326
nasm-macros.c is built. Now they build genmacro and generate nasm-macros.c
at build time, as it's no longer contained in the distribution.
svn path=/trunk/yasm/; revision=1205
dynamically loaded modules into the now-static libyasm. I now anticipate
that there would be very few users of the dynamic loading features, and it
yielded a lot of instability and build headaches for very little benefit.
The new build should now be much more cross-platform and faster (there was
a lot of overhead in finding and loading modules).
* libtool.m4, ltdl.m4: Delete.
* m4/Makefile.am: Rename to m4/Makefile.inc and remove references to above.
Change to use subdirectory (flat) build rather than recursive build.
* Makefile.am: Include m4/Makefile.inc rather than having it in SUBDIRS.
* libltdl: Delete.
* frontends/yasm/yasm-module.c: Delete.
* basename.c, dirname.c: Delete (no longer needed by yasm-module.c).
* genmodule.c, module.in: Generator and template for new module.c included
in libyasm that replaces the old yasm-module.c (module.in is a modified
rename of yasm-module.c).
* module.h: Modified rename of old yasm-module.h.
* libyasm.h: Include libyasm/module.h.
* libyasm/Makefile.inc: Build generator and include module.c in libyasm.
* yasm.c: Use new libyasm module interface.
* (many) Makefile.inc: Remove libtool libraries, build all modules into
libyasm library.
* configure.ac: Remove libtool/libltdl references.
* Mkfiles/vc/yasm-module.c: Remove. Still need to fix some of the other
Mkfiles/ build files for these changes.
svn path=/trunk/yasm/; revision=1183
Remove use of "inline". This could cause breakage on non-gcc systems (as
these files do not use config.h because of cross-build reasons).
* yasm.dep, yasm.mak, yasm.dsp, yasm.dsw: Remove support for VC6 builds.
* libyasm.dsp, libyasm.mak, libyasm.dep: Likewise.
* modules.dsp, modules.mak, modules.dep: Likewise.
* yasm.suo: Remove unneeded user options file.
* vc: Update svn:ignore property to reflect removal of VC6 builds and user
options file.
* genmacro.vcproj: Generate genmacro tool.
* genmacro/run.bat: Use genmacro to generate nasm-macros.c.
* modules.vcproj: Point to the new location for nasm-macros.c.
* re2c.vcproj: Generate re2c tool.
* re2c/run.bat: Use re2c to generate re2c-generated .c files.
* yasm.sln: Utilize genmacro and re2c.
svn path=/trunk/yasm/; revision=1144