Commit Graph

1704 Commits

Author SHA1 Message Date
H. Peter Anvin
67c637236a preproc: merge expand_mmac_params() and expand_indirect()
These two really need to be done together, in order for constructs
such as %[%1] to work properly.  Furthermore, fix a token-pasting bug
in expand_mmac_params().

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-26 23:49:00 -07:00
Charles Crayne
429265163e Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm 2008-10-26 17:33:43 -07:00
Charles Crayne
10a863d87e ELF64 support for PC relative offset to IE GOT entry
Add new WRT type ..gottpoff.
Generate R_X86_64_GOTTPOFF relocation entries
for references to thread local variables.
2008-10-26 17:32:38 -07:00
H. Peter Anvin
15c6be8d75 Merge branch 'nasm-2.05.xx' 2008-10-26 09:00:45 -07:00
H. Peter Anvin
9a65f71d64 Better description of the number-overflow warning
Better grammar and fix incorrect description of the number-overflow
warning (it is not just limited to 64-bit arithmetic overflow, it also
triggers when trying to squeeze in a value which is too large into an
immediate.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-26 08:59:04 -07:00
H. Peter Anvin
6f4e92b760 BR: 2196966: make the -w/-W options work again
The code to parse the -w/-W options was updating warning_on[], not
warning_on_global[], but warning_on[] is reset at the beginning of
each pass (to let the warning directive work); as a result the -w/-W
options don't actually do anything at all.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-26 08:57:13 -07:00
Charles Crayne
b0e0718267 Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm 2008-10-25 19:32:48 -07:00
Charles Crayne
efb515b98e Flag thread local symbols in symbol table
Set STT_TLS in symbol table for symbols declared
in thread local storage sections. Note that,
for now at least, such symbols must also be
declared as GLOBAL.
2008-10-25 19:31:09 -07:00
H. Peter Anvin
a168ab1e01 smartalign: clean up unnecessary duplication; tweak dependencies
Remove unnecessary duplicated patterns; with indirection we can handle
lists of any length.

For 16-bit generic padding, alternate between SI and DI dependencies.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-25 17:48:33 -07:00
Charles Crayne
4adf21c08c ELF64 segment definitions for TLS
Add default definitions for .tdata & .tbss sections
Add definition for SHF_TLS section header flag
Add support for "tls" keyword on section statement
2008-10-25 15:23:30 -07:00
H. Peter Anvin
9ee0ceadff For snapshot releases, expand out the mangled version numbers.
For snapshot releases, expand out the mangled version number,
e.g. 2.05.00.0.20081025.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-25 12:41:29 -07:00
H. Peter Anvin
92d36121b9 disasm: introduce opy
Introduce the opy pointer into the disassembler, and use it where
appropriate.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-25 00:42:51 -07:00
H. Peter Anvin
ae64c9d819 assemble: use opx and opy in a few more places
Use opx and opy in a few more places where we can do so.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-25 00:41:00 -07:00
H. Peter Anvin
c83f9de3b4 doc/changes.src: retroactively document anonymous %push
Retroactively document the anonymous %push, which was added in version
2.04 but not documented.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-24 16:53:53 -07:00
H. Peter Anvin
264b7b982c preproc: don't macro-expand the argument to %use
Use expand_id() for the argument to %use, instead of expand_smacro().
This really makes more sense for a "naked" argument.  This is a
semantic change, but is unlikely to break any real code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-24 16:38:17 -07:00
H. Peter Anvin
0b7d903ec8 doc: document %pop with argument
Document that %pop can now take an argument, and what it does.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-24 16:27:11 -07:00
H. Peter Anvin
42b5639664 preproc: allow %pop to take an identifier, unify %push/%repl/%pop
Allow the %pop directive to take an identifier (an assert on the
context name); unify the parsing parts of %push, %repl,  and %pop.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-24 16:24:21 -07:00
H. Peter Anvin
59c2e54f25 doc: document anonymous %push
The anonymous %push was never documented, document it now.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-24 16:19:03 -07:00
H. Peter Anvin
b34fce7111 doc/changes.src: begin the release notes for 2.06
The next version will presumably be called 2.06; begin collecting
release notes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-24 16:05:19 -07:00
H. Peter Anvin
df7d3e22fc doc: fix awkward word order
"the exactly same" -> "exactly the same"

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-24 10:15:46 -07:00
H. Peter Anvin
b2783e19a3 version.pl: don't add an extra .00 for subminor if we don't need it
When producing the mangled version number, don't add a subminor if
there isn't a patch level or release candidate number.  Thus, 2.05p1
is 2.05.00.01, but 2.05 can just be 2.05.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-24 10:10:32 -07:00
H. Peter Anvin
912595dfc0 Merge branch 'indirect' 2008-10-23 23:13:44 -07:00
H. Peter Anvin
33d5fc074f Fix op2 references that had not yet been converted; introduce opy
Fix op2 references not yet converted to accessing op2; add an opy
pointer similar to the opx pointer instead of multiple references.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 23:07:53 -07:00
H. Peter Anvin
941fcbb3ab disasm: extension byte support in the disassembler
Add support to the disassembler for the extension bytes (for operand
4+).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 23:03:59 -07:00
H. Peter Anvin
dcffe4b9f6 Add extension bytecodes to support operands 4+
The bytecode format assumes max 4 operands pretty strictly, but we
already have one instruction with 5 operands, and it's likely to get
more.  Support them via extension prefixes (similar to REX prefixes).
For bytecodes which use argument bytes we encode the number directly,
however.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 23:03:59 -07:00
H. Peter Anvin
b21141a301 When issuing warnings for EA displacements, use the *EA* operand
When issuing warnings for EA displacements during address generation,
actually look a the proper operand!

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 20:49:09 -07:00
H. Peter Anvin
584f7a8f57 NASM 2.05 2008-10-23 19:42:17 -07:00
H. Peter Anvin
7766ab0e0b doc/changes.src: update release notes
Update the release notes in preparation for NASM 2.05.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 19:29:28 -07:00
H. Peter Anvin
7dce7bc8a1 The CRC32 instructions can take 66 prefixes as well as F2
The CRC32 instructions require F2, but can also take a 66 prefix to
set the operand size.  This is not the SSE model of prefix extension.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 16:39:25 -07:00
H. Peter Anvin
bcc3bb975c test/crc32.asm: test the CRC32 instruction
Test for the CRC32 instruction.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 16:24:02 -07:00
H. Peter Anvin
019a98dab1 BR 2190521: fix the CRC32 opcodes
A stray \1 bytecode was hiding in the CRC32 opcodes, causing complete
havoc.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 16:23:19 -07:00
H. Peter Anvin
6c13a09e75 NASM 2.05rc8 2008-10-22 11:23:18 -07:00
H. Peter Anvin
49b3a3c2af BR 2187210: Fix PFRCPV and PFRSQRTV
Fix the Geode instructions PFRCPV and PFRSQRTV per bug report 2187210.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-22 11:18:27 -07:00
H. Peter Anvin
e286c7e79c assemble: not all backends handle intra-segment OUT_REL*ADR
Not all backends can handle being handled an intrasegment OUT_REL*ADR,
and we don't fix them up in common code either (which would be the
logical thing to do -- right now we fix them up in a bunch of
individual places.)

For now, just fix up the one in address generation.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-22 11:15:00 -07:00
H. Peter Anvin
9cd543e5fd BR 2148448: fix relative addresses in bin output
The "bin" format was misinterpreting the overloading of the "size"
argument to out(), which caused another source of 64-bit relative
offset errors.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-22 11:05:43 -07:00
H. Peter Anvin
d3fcbf051d Update .gitignore to include additional generated files
pptok.ph and doc/inslist.src are generated files; list them in
.gitignore.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 22:25:11 -07:00
H. Peter Anvin
207b1c4d3d test/ppindirect.asm: test token pasting inside %[...]
Test for token pasting inside %[...].

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 22:23:12 -07:00
H. Peter Anvin
49b33f398e preproc: fix terminal token pasting in indirect sequences
Fix the case where the terminal token pastes with the first token of
the unmodified sequence.  This is a really ugly version; we need to
merge the two instances plus the one in expand_mmac_params().

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 22:22:05 -07:00
H. Peter Anvin
e126581f4d preproc: error on unterminated %[...]
Make unterminated %[...] constructs an error.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 22:14:30 -07:00
H. Peter Anvin
ec03301eb4 preproc: fix exit conditions for indirection loop
When locating the end of a %[...] construct, we need to end up with
the pointer pointing to the terminating character.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 22:13:34 -07:00
H. Peter Anvin
ca544db4b6 preproc: correctly handle quoted strings inside %[...] constructs
We need to skip quoted strings when determining the ending point of
%[...] constructs.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 19:30:11 -07:00
H. Peter Anvin
0ca00860df doc: document the %[...] construct.
Add documentation for the %[...] construct.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 17:00:52 -07:00
H. Peter Anvin
2d4722fe4c test: better smartalign tests
Smartalign tests for 16, 32 and 64-bit mode.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 16:47:53 -07:00
H. Peter Anvin
f991f5ae56 smartalign: use a "times" construct rather than %rep
Use a "times" construct rather than "%rep" for higher performance.
No need to preprocess the same line over and over for no good reason.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 16:45:27 -07:00
H. Peter Anvin
9f9fcfa455 macros.pl: handle \-continuation lines in macros.pl
Correctly handle \-continuation lines in macros.pl.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 16:44:02 -07:00
H. Peter Anvin
777cdbee01 smartalign: rewrite to use the indirect construct, %[...]
This code can be made so much smaller with clever use of the
indirection construct.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 16:38:28 -07:00
H. Peter Anvin
45d5f2f822 test: add test for preprocessor indirection construct
Add a test for the preprocessor indirection construct, %[...].

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 16:25:57 -07:00
H. Peter Anvin
c0ab1cd15a preproc: fix list iteration in the case of expand_indirect()
Linked lists where an element may be deleted or substituted during
processing can be subtle to deal with.  Fix the iteration conditions
in this particular case.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 16:24:53 -07:00
H. Peter Anvin
992fe7591d preproc: Add new %[...] indirection construct
Add a new %[...] construct to support indirect macro expansion.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 15:45:05 -07:00
H. Peter Anvin
8b5e68079a NASM 2.05rc7 2008-10-19 14:53:48 -07:00