Commit graph

2055 commits

Author SHA1 Message Date
Peter Johnson
b334347286 win64: Default to nobase for .xdata section.
Also add ..imagebase special symbol to force use of a nobase relocation.

[#135 state:resolved]
2011-10-30 22:21:57 -07:00
Peter Johnson
2bd66514b6 re2c: Use tmpfile instead of fixed temporary filename.
This could cause a race condition when running parallel make.

Tracked down by Volker Braun.

[#238 state:resolved]
[#165 state:resolved]
2011-10-02 23:20:38 -07:00
Peter Johnson
cc4657a134 Merge pull request #60 from olsner/struc_base
Implement the base offset parameter for the struc macro
2011-10-02 22:11:01 -07:00
Simon Brenner
d19cbdabab Add testcase for struc with base offset 2011-10-02 06:03:29 +02:00
Simon Brenner
25a46fa5b0 Implement the base offset parameter to 'struc' 2011-10-02 06:03:29 +02:00
Peter Johnson
716c17112d nasm-pp.c: Plug a memory leak. 2011-09-30 12:52:32 -07:00
Peter Johnson
eb8b346157 Merge pull request #59 from pwo/patch-1
Fix clang warning.
2011-09-27 23:18:15 -07:00
Pawel Worach
a2cbb10ee1 Fix clang warning:
libyasm/md5.c:166:31: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
        memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */
               ~~~            ^~~
2011-09-24 16:41:08 +03:00
Peter Johnson
0e3fa2d6d1 Makefile.am: Clean YASM-VERSION.h. 2011-09-03 21:27:21 -07:00
Peter Johnson
451bfd6374 Fix .gitignore for some wildcards. 2011-09-03 21:18:34 -07:00
Peter Johnson
e11ea9df14 Add missing macho32-pext test case. 2011-09-03 21:18:08 -07:00
Peter Johnson
c3b483199c Regenerate man pages. 2011-08-27 16:28:25 -07:00
Peter Johnson
7d58243134 macho: Support N_PEXT bit.
Can be enabled via use of "private_extern" in NASM syntax.

Patch by: Hironori Bono

[#215 state:resolved]
2011-08-27 10:01:26 -07:00
Peter Johnson
0ed2cc4451 Generate version number information from git history.
Due to the svn import structure, a special case is currently implemented
to look for the 1.1.0 branchpoint instead of the most recent tag on the
master branch.  This will be removed after the first release is tagged
on the master branch in git.

Specific details:

autogen.sh: More aggressively clean autoconf cache.
This is needed to ensure the version number is actually regenerated.

Don't generate PACKAGE_PATCHLEVEL or PACKAGE_BUILD variables.  The
genversion program now parses PACKAGE_VERSION directly.

For Mkfiles builds, YASM-VERSION.h is generated and included by the custom
config.h.  This avoids the need to edit config.h for versioning.
2011-08-27 09:25:30 -07:00
Peter Johnson
8281be0c25 Add .gitignore files.
These are based on the old svn:ignore properties.
2011-08-27 09:24:07 -07:00
Peter Johnson
94ab1135a3 Remove $Id$ and RCSID() usage.
These are useless now that we're using git.
2011-08-19 10:43:16 -07:00
Peter Johnson
502eebd339 Fix const warning in elf_machine_ssym usage.
Reported by: Pierre Muller

[#237 state:resolved]
2011-08-19 10:21:10 -07:00
Peter Johnson
d8d1a5ad90 win64-except.c: Fix incorrect dereference.
Reported by: Pierre Muller

[#236 state:resolved]
2011-08-19 10:14:31 -07:00
Peter Johnson
a9b943e5db file.h: Separate conditional inclusion of direct.h.
This fixes builds on mingw64.

Reported by: Pierre Muller

[#235 state:resolved]
2011-08-19 10:14:14 -07:00
Peter Johnson
40da5cb2c7 dwarf: Fix uninitialized structure member.
dwarf2_loc.discriminator wasn't being initialized by
dwarf2_generate_line_section, leading to incorrect output, including
intermittent test failures in gen64/dwarf64_pathname.
2011-07-11 00:15:30 -07:00
Peter Johnson
bd8401d538 expr_simplify_identity: Pass int_term via pointer.
This allows signaling to the caller (expr_level_op) that the int_term
was destroyed.  Without this, the new expr-simplify-identity testcase
has a use-after-free.

[#232 state:resolved]
2011-07-10 23:44:18 -07:00
Peter Johnson
3b65acb39d Fix VGATHER/VPGATHER memory sizes.
These now match the memory fetch sizes in the AVX reference.

Reported by: nasm64developer
2011-07-04 11:35:19 -07:00
Peter Johnson
ab721f347d Add AVX2 VGATHER* and VPGATHER* instructions.
These instructions use "VSIB" encoding, which takes the place of the
usual SIB encoding.  Several tests cover various legal and illegal
modes.

Last part of [#227 state:resolved].
2011-07-03 19:54:45 -07:00
Peter Johnson
d779fcb04e Add most Intel AVX2 instructions.
Reference: http://www.intel.com/software/avx rev11 spec

This is all AVX2 instructions except for VGATHER*/VPGATHER*, which
require additional ModRM handling.

Portions contributed by: Mark Charney <mark.charney@intel.com>

Part of [#227].
2011-07-03 14:36:37 -07:00
Peter Johnson
fc7724a3df pmovmskb/vpmovmskb: default operand size is 64 bits. 2011-07-03 12:48:46 -07:00
Peter Johnson
47f693fd89 Add Intel BMI1, BMI2, INVPCID, LZCNT instructions.
Reference: http://www.intel.com/software/avx rev11 spec

Also add appropriate CPU bits and directive handling for these.

Currently we have no good way of handling an "or" of instruction bits
(in this case needed for LZCNT, where it's either AMD or LZCNT).  For
now, make it LZCNT only.

Contributed by: Mark Charney <mark.charney@intel.com>

Part of [#227].
2011-07-03 01:48:44 -07:00
Peter Johnson
0614dede9b x86/gas: Fix no-suffix push and pop.
Previously plain "push" and "pop" would always generate a 16-bit pop
(for effective address versions).

Reported by: Alexei Svitkine

[#212 state:resolved]
2011-07-02 17:11:10 -07:00
Peter Johnson
f12d030f90 Add test for 64-bit shr/shl. 2011-07-02 16:28:29 -07:00
Peter Johnson
5d5ad1d91c Allow 64-bit LFS/LGS/LSS.
[#229 state:resolved]
2011-06-27 23:48:28 -07:00
Peter Johnson
de38127f1c Fix "times" relocation handling.
Previously a line such as "times 4 mov rax, [rel foobar]" would result
in incorrect relocations being generated.

Patch by: bird-yasm@anduin.net

[#211 state:resolved]
2011-06-25 23:32:22 -07:00
Peter Johnson
ac59d2353b Fix cython.m4 for beta versions of Cython.
[#204 state:resolved]
2011-06-25 15:09:03 -07:00
Peter Johnson
2f6162a0ae Fix build with recent Cython.
[#216 state:resolved]
2011-06-25 14:58:27 -07:00
Peter Johnson
19d85dfe84 Fix #263: Add quotes to yasm.rules switches. 2011-06-20 23:32:27 -07:00
Peter Johnson
b96cc7d9b2 Fix escaping at end of gas string constant.
Patch by: Daniel Diaz <Daniel.Diaz@univ-paris1.fr>
2011-05-29 15:29:15 -07:00
Peter Johnson
3bf0ed3927 Fix lar and lsl second operand size.
Also support 32-bit second operand for extra compatibility against ISA
documentation, although only the low 16 bits are used.

Fixes #261.
2011-05-29 13:14:22 -07:00
Jari Aalto
49c9e09429 frontends/yasm/yasm.xml: Use GNU layout and put --help option to the end
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Peter Johnson <peter@tortall.net>
2011-05-29 12:56:17 -07:00
Peter Johnson
1143fb7520 Fix test failure due to build environment.
When YASM_TEST_SUITE environment is defined, force version to "yasm
HEAD" and all yasm__getcwd() calls to return "./".
2011-03-20 21:18:01 -07:00
Brian Gladman
db258a7b50 1. Tidy up VS 2010 build
2. Set correct VS tool path on win32 systems

svn path=/trunk/yasm/; revision=2368
2011-01-29 10:50:25 +00:00
Peter Johnson
65f6f7a1ff Fix #223: Correctly handle "./" paths in dwarf2.
As dwarf2 has a directory table in addition to a filename table, we split
the provided pathname when generating the filename table.  This correctly
combined both "./foo" and "foo" into a single filename table entry.
However, we were only matching on pathname instead of dir+filename when
actually generating the dwarf opcodes, resulting in not finding the "./foo"
version.  Fix to check both dir and filename separately, splitting the same
way we do when generating the filename table.

svn path=/trunk/yasm/; revision=2367
2010-09-06 19:33:25 +00:00
Peter Johnson
5355299056 Improve gas syntax .set directive to better match GNU as behavior.
- Add support for deferred symbols (those which depend on other symbols
  that have not yet been .set)
- Add support for re-defining symbols
- Add support for 0x hex notation in literals

Contributed by: Alexei Svitkine <alexei.svitkine@gmail.com>

svn path=/trunk/yasm/; revision=2366
2010-08-21 07:32:54 +00:00
Peter Johnson
bafc905860 coff: Add support for gas .secrel32 directive.
svn path=/trunk/yasm/; revision=2365
2010-08-18 06:23:30 +00:00
Peter Johnson
7263e1d241 Implement yasm_value_finalize_expr() using yasm_value_finalize().
Previously this was implemented the opposite way, contrary to its
documentation.  This resulted in clearing any already set yasm_value
relative fields.

svn path=/trunk/yasm/; revision=2364
2010-08-18 06:23:06 +00:00
Peter Johnson
50017b49af Add prototype for yasm_dv_get_value().
svn path=/trunk/yasm/; revision=2363
2010-08-18 06:21:34 +00:00
Peter Johnson
72df1b52a2 Add yasm_dv_get_value() to get yasm_value from yasm_dataval.
svn path=/trunk/yasm/; revision=2362
2010-08-18 06:21:08 +00:00
Peter Johnson
2f82e3a7ba coff dir_def(): Use symtab_use() instead of symtab_get().
svn path=/trunk/yasm/; revision=2361
2010-08-17 05:36:18 +00:00
Peter Johnson
5fb3213be3 coff/win32/win64: Add support for .def, .scl, .type, and .endef directives.
These can be used to set a specific value for the coff sclass and type
symbol fields.

svn path=/trunk/yasm/; revision=2360
2010-08-17 05:32:46 +00:00
Peter Johnson
985038f102 dwarf2: Add support for .loc "discriminator" option.
svn path=/trunk/yasm/; revision=2359
2010-08-16 02:28:36 +00:00
Peter Johnson
2678cb3c3a gas: Fix movsw/movzw memory operand encodings.
The register versions worked okay due to size matching, but the memory
versions relied on suffix matching, which wasn't being generated correctly.

Reported by: Tony Goelz <cag@absoft.com>

svn path=/trunk/yasm/; revision=2358
2010-08-14 02:26:41 +00:00
Peter Johnson
3ef8f426d7 Bump trunk internal version to 1.1.99.
svn path=/trunk/yasm/; revision=2351
2010-08-06 08:14:51 +00:00
Peter Johnson
0d3b3797e5 Fix #213: Fix gas-preproc misuse of strcpy() and uninitialized variables.
- strcpy() was being used with overlapping memory ranges; switched to memmove().
- bline->line_number was not set in one location.

Exact causes identified using valgrind.

svn path=/trunk/yasm/; revision=2348
2010-08-01 17:44:56 +00:00