Initial patch by: Thomas Weidenmueller <thomas@reactsoft.com>
The NASM preprocessor implementation of this is ugly; the preprocessor
really needs a rewrite to clean it up, but there's other higher-priority
items on the TODO list.
svn path=/trunk/yasm/; revision=1211
undocumented (in NASM) win32 object format "export" directive.
(yasm_win32_LTX_objfmt): Reference above instead of coff_objfmt_directive.
(coff_objfmt_section_switch): Add support for ".drectve" section.
(coff_objfmt_init_new_section): Refactored from coff_objfmt_section_switch.
* preproc.h (yasm_preproc_module): Add define_builtin for defining macros
before standard.mac macros are processed.
(yasm_preproc_builtin_define): Add prototype and macro to call above.
* raw-preproc.c (raw_preproc_define_builtin): Add (empty).
(yasm_raw_LTX_preproc): Use.
* nasm-preproc.c (nasm_preproc_define_builtin): Add wrapper around new
pp_builtin_define.
(yasm_nasm_LTX_preproc): Use.
* nasm-pp.h (pp_builtin_define): Add prototype.
* nasm-pp.c (builtindef): New list of builtin definitions.
(read_line): Iterate through builtindef.
(pp_builtin_define): Add to builtindef.
* standard.mac: Add wrapper around definition of ORG (only for bin objfmt),
add wrappered EXPORT definition.
* yasm.c (apply_preproc_builtins): Define __YASM_OBJFMT__ to selected objfmt.
(main): Call above in correct places.
* export.asm, export.hex, export.errwarn: New test for use of "export" macro
and directive.
svn path=/trunk/yasm/; revision=1199
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
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
(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
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
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
- 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
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
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
the original input file, which was then closed again by the frontend. Fix
saves the original file passed in and special-checks for it before calling
fclose().
svn path=/trunk/yasm/; revision=951
- Move config.h and util.h from libyasm (and installed libyasm) to top level.
- Move yasm_* functions from util.h to coretype.h.
- Remove a number of autoconf-related YASM_*_INTERNAL options from libyasm.h.
- Rename YASM_INTERNAL to YASM_LIB_INTERNAL; it now actually means what the
comment describes: enables definitions that violate the yasm_* namespace.
While we're at it, no longer define YASM_LIB_INTERNAL from yasm frontend, so
it's closer to what a real typical libyasm-using application would look like.
svn path=/trunk/yasm/; revision=944
nasm_free() to handle it, which it does as yasm_xfree(). But to avoid dmalloc
complaints, check for the NULL beforehand if dmalloc is in use.
svn path=/trunk/yasm/; revision=941
from yasm_keyword (separating same-keyword modules of different types). Update
yasm frontend module loader to handle this.
svn path=/trunk/yasm/; revision=921
var: db 5
varlen equ $-var
%if varlen>100
...
%endif
by always acting like we're in preprocess-only mode and adjusting error
message appropriately.
This would be HARD to truly fix, as yasm only parses the input once.
svn path=/trunk/yasm/; revision=920
When -Werror is used, disable -Wconversion, because flex-generated code causes
warnings when calling fwrite() and fread().
svn path=/trunk/yasm/; revision=873
licensing issues with this. All the compiler warnings have been fixed, and
most namespace issues resolved. However, the integration isn't perfect, and
there are probably memory leaks. Note that right now the real NASM preproc
and "compatible" NASM parser share a module. The parser should probably be
renamed to avoid extra loading and code source confusion.
svn path=/trunk/yasm/; revision=800
libintl dependency in modules.
Also standardize initialize() and cleanup() functions.
Move replace_extension() from file.c to main.c.
Clean up some extern variable declarations in various places (particularly
nasm-compatible parser).
svn path=/trunk/yasm/; revision=792