darealshinji [Thu, 5 Nov 2015 17:57:21 +0000 (18:57 +0100)]
fixing an argument parsing bug in ytasm
Taken from a Debian patch.
More information can be found at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=716639
http://anonscm.debian.org/viewvc/sam-hocevar/pkg-misc/unstable/yasm/debian/patches/100_ytasm_parsing_error.diff?view=log
Peter Johnson [Sat, 27 Sep 2014 04:12:42 +0000 (21:12 -0700)]
COFF/PE: Always set paddr and vaddr to 0.
It appears that GNU binutils always interpret PE/COFF object files as if
they were executable files, namely that the paddr field is a rounded-up
section size (aka virtual size). Yasm previously followed the Microsoft
specification which stated that for object files this field should be set
to the "physical address" of the section (e.g. the sum of all previous
section sizes). However, several other sources state this field should be
set to 0 in object files, and it appears that Microsoft tools accept this.
For compatibility with the GNU tools, this commit makes Yasm always set the
paddr/vsize field to 0.
This commit also eliminates the COFF_SET_VMA customization for COFF
files. Previously this was used to set LMA=VMA in COFF, but LMA=0 in PE.
Now that VMA is always 0, this is no longer required (LMA=VMA=0 in both
PE and COFF).
Peter Johnson [Sat, 20 Oct 2012 00:23:26 +0000 (17:23 -0700)]
Add support for "function" decorator in win32/win64.
This can be used on global directives (e.g. global _foo:function) to
indicate the global is a function. This is useful for incremental
linking in MSVC.
Changed segment:offset calculations so that vstart = 16*segment +
offset and vseg = segment instead of vstart = offset. Without this the
existing code to infer vstart addresses is not useful.
sergey semenko [Mon, 27 Feb 2012 10:07:03 +0000 (12:07 +0200)]
Added support for HSW TSX instructions:
XAXQUIRE
XRELEASE
XABORT
XBEGIN
XEND
XTEST
Also fixed a bug for CALL instruction (opcode 0xE8) - it allowed 16 bit operand with 0x66 prefix in 64 bit mode,
while 16 bit operand is not allowed at all in 64 bit mode.
Added X86_ACQREL prefix group for XACQUIRE/XRELEASE prefixes, since they need to be orthogonal to LOCKREP
prefixes, because TSX prefixes must come together with F0 (LOCK) prefix.
However this commit does not enforce using TSX hints only with instructions they are allowed to be used.
The reason for this is that lock prefix F0 itself is not enforced to be used only with lockable instructions, this seems to be a decision made by
Yasm developers, that user himself must take care of these situations.
Right now TSX hints can come with F0 prefix, can come with REPNE/REPZE prefixes, but they are used together in assembly, only the leftmost would be
encoded to the binary and warning will be issued. This is the behavior of Yasm for duplicate LOCKREP prefixes.
Peter Johnson [Mon, 31 Oct 2011 06:50:31 +0000 (23:50 -0700)]
re2c: Work around tmpfile() issue on win32.
tmpfile() defaults to C:\, and on Windows 7 can run into permissions issues.
Add workaround implementation from cairo
(http://cgit.freedesktop.org/cairo/commit/?id=4fa46e3caaffb54f4419887418d8d0ea39816092)
See also: http://msdn.microsoft.com/en-us/library/x8x7sakw(v=VS.80).aspx
(community content section)
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 */
~~~ ^~~
Peter Johnson [Sat, 27 Aug 2011 16:25:30 +0000 (09:25 -0700)]
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.