Two forms are legal ({} are replaceables):
SECTION {segname} {sectname}
SECTION {sectname} segname={segname}
Also,
SECTION {sectname}
where sectname is unrecognized is also legal, defaults segname to __TEXT,
and generates a warning.
Contributed by: bird-yasm@anduin.net
svn path=/trunk/yasm/; revision=1852
makes value/parameters more well-defined and flexible enough to handle
string parameters. Value/parameters would now be better called name/values,
but avoid changing the name for now.
svn path=/trunk/yasm/; revision=1851
from libyasm core. Now absolute sections are tracked locally to the parser
and the parser generates EQUs directly for labels in absolute sections.
Fixes#106 and #103.
svn path=/trunk/yasm/; revision=1842
been using a mix of tabs and 4 spaces to indent; this looks horrible if
tab size is ever not 8. While I debated converting to tab-only indentation
that would have been a far higher impact to the source.
svn path=/trunk/yasm/; revision=1825
and common declare. The latter no longer passes through objfmt at parse time;
instead the objfmt must handle them at output time (objfmt-specific
extensions are parsed & stored by the parser). Directives are now handled
using a list (with function pointers) rather than a single function entry
point.
svn path=/trunk/yasm/; revision=1819
yasm_dbgfmt, and yasm_arch. This eliminates a lot of redundant keeping
track of this information in the individual object and debug formats and
also simplifies a fair amount of code.
I'm still not happy with how arch gets passed around in output code, but
there may not be much of an alternative there.
While I'm here, clean up some unused variables and functions and re-enable
the warning for unused variables in configure.ac.
svn path=/trunk/yasm/; revision=1812
in load commands. This caused test miscompares on other platforms and
could conceivably cause yasm to crash by reading beyond proper boundaries
(but this is unlikely). Functionally the output is the same.
Reported by: christophe.malvasio1@aliceadsl.fr
Backport in: 1 week
svn path=/trunk/yasm/; revision=1811
build platform files.
While here, fix a few warnings by pushing uintptr_t to a few more register
usages.
Noticed by: rugxulo@gmail.com
svn path=/trunk/yasm/; revision=1786
Requested by: Myria Chan, Brian Gladman, several others
Helped by: Brian Gladman (format documentation pointers)
This commit adds the necessary directives and some higher-level macros to
make it easier to generate the .xdata and .pdata sections needed for
structured exception handling on Win64. The overall construction mirrors
MASM very closely, so it should be possible for near-direct translation of
MASM code to Yasm; see for example objfmts/win64/tests/sce3.masm and
objfmts/win64/tests/sce4.asm. This commit does *not* break generating these
yourself (which you may want to do if you're a compiler).
This commit adds special proc macros so the function layout will look like:
proc_frame <procname>
... (frame setup and unwind directives)
end_prologue (or alternatively [endprolog])
...
endproc_frame
The "raw pseudo operations" (.directives) as described in MSDN
(http://msdn2.microsoft.com/en-us/library/ms235231(VS.80).aspx)
have been exactly mirrored in Yasm, as follows:
[pushreg], [setframe], [allocstack], [savereg], [savexmm128], [pushframe],
[endprolog]
Note the [] are required.
Additionally, the following macros have been implemented that MASM provides
in ksamd64.inc, and as documented in MSDN
(http://msdn2.microsoft.com/en-us/library/ms235217(VS.80).aspx):
push_reg, rex_push_reg, push_eflags, rex_push_eflags, alloc_stack,
save_reg, save_xmm128, push_frame, set_frame, end_prologue
I'll next work on getting all of this documented in the user manual.
svn path=/trunk/yasm/; revision=1762
a lower level.
To reduce code duplication, refactor several of the large if/else structures
into multiple functions with a lookup table.
Add support for registers to be used in directive expressions.
Allow directives to have underscores and numbers (still cannot start with
numbers).
svn path=/trunk/yasm/; revision=1757
NASM behavior with regards to e.g. extern $foo.
Unfortunately this makes yasm start not matching NASM behavior with regards
to the RDF module directive. In NASM, module $foo results in a literal $foo
reference; yasm now requires either a double $ (e.g. $$foo) or quotes (e.g.
"$foo"). The special case for section (section $foo --> literal $foo) is
still present, but keeping this for other directives is extremely difficult.
svn path=/trunk/yasm/; revision=1754
bytecode multiple.
strucsize.asm tests both creation and instantiation of a nested structure.
[1751] and [1752] fix bugs found during the testing of the instantiation
portion of this testcase.
A side effect of this change is that some errors are found in different
phases, and the error messages are slightly different. Split
reserve-error.asm testcase into two parts to still get full coverage.
svn path=/trunk/yasm/; revision=1753
timestamp to determine if the object file has been updated, so not setting it makes for
bad behavior (the object file gets updated, but when the executable is linked it uses the
older "internal" version).
To keep tests passing, check an environment variable (YASM_TEST_SUITE); if this exists, the
timestamp is set to 0. Set this environment variable in out_test.sh.
svn path=/trunk/yasm/; revision=1742
Contributed by: Henryk Richter <henryk.richter@comlab.uni-rostock.de>
This adds 3 object format keywords: macho, macho32, macho64. These work in
the same way as elf, elf32, and elf64. The object format is still a work
in progress; amongst other things it does not yet support full cross-section
references (othersym1-othersym2), dynamic linking, or GAS input syntax. We
will continue to improve and work on these features in the near future.
svn path=/trunk/yasm/; revision=1732
(such as the common .note.GNU-stack section). While Yasm allows such section
names by enclosing with double-quotes, NASM allows this, so for compatibility
it makes sense for Yasm to as well.
svn path=/trunk/yasm/; revision=1723
parser with one token of lookahead. This allows for better error handling
and proper handling of things like "xxxx"/5. There may be a minor speedup
but it's probably a wash.
Still TODO:
- Unify the expression parser with the NASM preproc one.
- Change the GAS parser to recursive descent.
Only had to change one test result; this is due to re-ordering of symrec
creation versus symrec use in data expressions such as x db y. With the
Bison parser, the symrec use (y) would come first, now the symrec creation
(x) comes first.
svn path=/trunk/yasm/; revision=1716
such that only ELF and COFF actually handle .ident; all other object
formats silently ignore it.
In Win32/Win64, the .ident contents are dumped into the .rdata$zzz section
rather than the .comment section as in COFF and ELF; this is due to the
fact the GNU linker for Win32 is broken and puts .comment in the output
executable as a separate section, breaking the executable. The .rdata$zzz
name matches that used by GAS to work around this same linker bug.
Reported and tracked down by: Peter Tanski <p.tanski@gmail.com>
svn path=/trunk/yasm/; revision=1712
(sym in other section)-(sym in this section) rather than just
(sym in other section)-(curpos) (e.g. sym-$). Unfortunately supporting
this required precbc to be flowed down to the value_finalize functions,
but it's relatively reasonable to do so, as all of the _finalize() routines
have access to precbc.
Reported by: Peter Tanski <peter_tanski@cox.net>
svn path=/trunk/yasm/; revision=1705
other testcase changes).
While I'm here, fix handling of arith [], dword X in 64-bit mode by making
this an error; it's impossible to tell if add dword [], X or add qword [], X
is meant as the immediate part is always a dword. This is only important for
arith rather than other memory instructions due to dword also being needed
for optimization.
Next step: support strict for jump sizing and optimize non-strict sized
jumps.
svn path=/trunk/yasm/; revision=1680