Commit graph

1112 commits

Author SHA1 Message Date
Peter Johnson
41762bead1
Update Mach-O for newer macOS (#180)
- Create a dummy .llvmasm section for bitcode
- Add [buildversion] directive for setting minos and sdk versions, e.g. [buildversion minos="10.14" sdk="10.14"]. This defaults to 10.5 on x64 and 10.4 on x86.
2021-07-10 12:12:45 -07:00
Peter Johnson
f01afb6b51
Fix test failures (#177)
These were caused by the addition of the segreg-in-64bit warning.
2021-07-09 13:42:53 -07:00
Denis Denisov
bd283fe523
Revert optimizations added in #68 (#146) 2020-05-03 23:36:45 -07:00
Ozkan Sezer
976d2e0934
Fix info.stab / info.stabstr typo in stabs-dbgfmt.c (#96) 2020-05-03 23:35:04 -07:00
mostynb
e256985c49 avoid 'return value of ftruncate ignored' warnings (#76) 2017-09-23 15:14:23 -07:00
Matt Oliver
6eac25ff8c allow movbe to be suffixed with wlq in gas syntax. 2017-09-23 15:11:49 -07:00
Matt Oliver
7418458622 fix memory errors when using gas processor with coff object output. 2017-09-23 15:11:49 -07:00
bird2tori
4808260d62 Leak fixes (#79)
* preproc/nasm: Close the input file; addressed a few memory leaks.

* yasm.c: delete include paths before we exit

* cv-dbgfmt.c: Free cv_filename::filename too.
2017-09-23 15:08:58 -07:00
Paul Blinzer
91d628ac60 New AMD Excavator MONITORX, MWAITX instruction support (for 32bit/64bit) (#78)
MONITORX has opcode "0F 01 FA".
rAX contains address to be monitored
ECX specifies optional extensions
EDX specifies optional hints

MWAITX has opcode "0F 01 FA".
EAX specifies optional hints
ECX specifies optional extensions

Public documentation: http://support.amd.com/TechDocs/24594.pdf

New CLZERO instruction support (for 32bit/64bit)
		* clzero has opcode "0F 01 FC".
		* clzero gets enabled with CPUID, 8000_0008, EBX[0] =1.
		* clzero instruction zero's out the 64 byte cache line specified in rAX. Bits 5:0 of rAX are ignored

Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
Redistributed under simplified 2-clause BSD licence
2017-09-23 15:08:03 -07:00
Peter Johnson
51af4082cc Added -Wno-segreg-in-64bit.
This allows suppressing the annoying 'segment register ignored in 64-bit mode'
warning.
2015-11-06 20:15:04 -08:00
Henrik Gramner
32ad9c46ce Support numbers prefixed with + or - in %ifnum 2015-10-17 21:50:15 +02:00
Peter Johnson
bf8411efa8 Merge pull request #68 from jix/master
Optimization and improved @jix
2015-01-01 21:51:00 -08:00
Denis Denisov
0c2d90c6b3 Fix yasm segfaults GNU assembler files on OS X
Bug: http://tortall.lighthouseapp.com/projects/78676/tickets/269
2014-11-15 23:37:54 +02:00
Peter Johnson
1910e91479 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).
2014-09-26 21:12:42 -07:00
Peter Johnson
4c2772c3f9 Add missing objfmt_x64 to CMakeLists.txt.
This caused cmake builds to not recognize "x64" as an object format.

Reported by: Brian Gladman
2014-09-19 00:46:15 -07:00
Peter Johnson
636dc92558 Allow building of static executables with cmake. 2014-08-10 23:18:46 -07:00
Peter Johnson
00c85278d1 Warnings cleanup. 2014-08-10 11:39:20 -07:00
Peter Johnson
86fc07b574 coff-objfmt.c: Add missing break.
[#268 state:resolved]
2014-04-13 23:00:03 -07:00
Peter Johnson
047c49b542 Add cpu ivybridge, haswell, broadwell, skylake. 2014-04-05 23:34:27 -07:00
Peter Johnson
0ca0ffc65f Add Intel ADX, RDSEED, and SMAP instructions. 2014-04-05 00:17:13 -07:00
Peter Johnson
1a0c61d29e Add Intel SHA instructions.
Contributed by: Mark Charney @ Intel
2014-02-14 12:03:54 -08:00
Henrik Gramner
e32ff2c2ab Use a larger hash table size
Increases compilation speed of files with a large number of macros by
around 20x.
2014-01-21 00:24:40 +01:00
Peter Johnson
a24f4841f7 cv8: Fix line number issues with multiple files.
Patch by: Knut St. Osmundsen

[#263 state:resolved]
2013-07-03 11:06:56 -07:00
Peter Johnson
c3aa2478c6 Unbreak distcheck. 2013-06-21 10:03:05 -07:00
Peter Johnson
31c99f1fb2 Fix vpbroadcastq.
Patch by: Jason Garrett-Glaser <jason@x264.com>
2013-06-21 10:03:05 -07:00
Peter Johnson
1db998a3d3 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.
2012-10-19 17:25:27 -07:00
Peter Johnson
73caedeebd gas-parse.c: Eliminate warning. 2012-08-30 23:53:41 -07:00
H.J. Lu
510c8dd7e6 Add support for x32
X32 is a 32-bit psABI for x86-64 with 32-bit pointer size.  More info
can be found at:

https://sites.google.com/site/x32abi/
2012-08-30 23:47:41 -07:00
Peter Johnson
9728322335 Merge pull request #64 from sgraham/fix-win32-warnings
Fix a couple warnings when building on win32
2012-08-30 23:40:42 -07:00
Peter Johnson
96edd8aa0e Fix vphaddudq opcode; should be DB rather than D8. 2012-08-18 13:55:10 -07:00
Jannis Harder
c02c6c72d0 Interpret vstart as linear address
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.
2012-08-01 15:32:21 +02:00
Jannis Harder
15e9012b77 Generate segmented addresses for labels
- Labels defined inside sections with vseg have segment:offset
  addresses
- The section.<section name>.vstart label has a segment:offset
  address
2012-08-01 15:32:21 +02:00
Jannis Harder
aaea0fc138 Add segments to label addresses
Generate addresses with a segment part for labels inside a section
with a defined vseg
2012-08-01 15:32:21 +02:00
Jannis Harder
d36aecd48c squashme 2012-08-01 15:30:50 +02:00
Jannis Harder
8da658af79 Overrides and dummy value finalization for bin
- Added support for overriding certain functions
- Override value_finalize with dummy function for the bin objfmt
2012-07-31 13:01:22 +02:00
Jannis Harder
90a8e215d6 Add vseg section option
- Added vseg and ivseg to bin_section_data
- Parsing of vseg option as expression
- Conversion to integer ivsg
- Output of vseg in mapfiles
2012-07-31 13:01:15 +02:00
Vivek Thampi
0e7f34a025 Fix minor typo in the definition of pmulhrw
This change fixes the definition of "pmulhrw" where it is defined
as having the mnemonic "pmulhrwa".
2012-05-28 23:59:55 -07:00
Scott Graham
51b1f7ef98 fix a couple warnings when building on win32 2012-05-09 20:48:16 -07:00
Nico Weber
203bc94f39 Don't use a C++ comment in a C source file. 2012-03-10 22:52:34 -08:00
Nico Weber
01ab853e68 In the Mach-O writer, only warn on ignored flags if the new flags
are different from the old flags.

Fixes http://tortall.lighthouseapp.com/projects/78676-yasm/tickets/246
2012-03-06 17:40:41 -08:00
sergey semenko
916ff048f7 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.
2012-03-02 14:36:30 -08:00
Jason Garrett-Glaser
a8495ad151 Add AMD TBM instructions.
Reference: http://support.amd.com/us/Processor_TechDocs/24594_APM_v3.pdf

Also add appropriate CPU bits and directive handling for these.
2012-03-02 14:29:21 -08:00
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
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
e11ea9df14 Add missing macho32-pext test case. 2011-09-03 21:18:08 -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
94ab1135a3 Remove $Id$ and RCSID() usage.
These are useless now that we're using git.
2011-08-19 10:43:16 -07:00