platform/upstream/nasm.git
15 years agoAUTHORS: Update information for HPA
H. Peter Anvin [Wed, 8 Apr 2009 20:49:48 +0000 (13:49 -0700)]
AUTHORS: Update information for HPA

15 years agoNASM 2.06rc10
H. Peter Anvin [Wed, 8 Apr 2009 05:10:35 +0000 (22:10 -0700)]
NASM 2.06rc10

15 years agoDocument preprocessor token concatenation fix.
H. Peter Anvin [Wed, 8 Apr 2009 05:09:05 +0000 (22:09 -0700)]
Document preprocessor token concatenation fix.

15 years agoHandle weird cases of token pasting
H. Peter Anvin [Wed, 8 Apr 2009 04:59:24 +0000 (21:59 -0700)]
Handle weird cases of token pasting

Especially when token pasting involves floating-point numbers, we can
have some really strange effects from token pasting: for example,
pasting the two tokens "xyzzy" and "1e+10" ends up with *three*
tokens: "xyzzy1e" "+" "10".  The easiest way to deal with this is to
explicitly combine the string and then run tokenize() on it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.06rc9
H. Peter Anvin [Wed, 8 Apr 2009 03:59:41 +0000 (20:59 -0700)]
NASM 2.06rc9

15 years agonasm.nsi: add COPYING to the list of files to package
H. Peter Anvin [Tue, 7 Apr 2009 02:37:30 +0000 (19:37 -0700)]
nasm.nsi: add COPYING to the list of files to package

15 years agonasm.nsi: add NASM Manual; automate version generation
H. Peter Anvin [Tue, 7 Apr 2009 02:12:34 +0000 (19:12 -0700)]
nasm.nsi: add NASM Manual; automate version generation

Add the NASM Manual (as a PDF) to the Windows installer, and abstract
out the version number.

15 years agoAdd NSIS script to make a Windows installer
Shao Miller [Tue, 7 Apr 2009 02:07:37 +0000 (19:07 -0700)]
Add NSIS script to make a Windows installer

Here is an NSIS script for making a simple NASM package.  It creates a
NASM folder with some of the important binaries in it, as well as a
simple batch file to get a CLI with the NASM folder included in the
PATH.  Expects to be built from inside the bin/ directory.  Fairly
primitive.  Feedback welcome.  - Shao

15 years agoAdd STRUC change to changes.src
Victor van den Elzen [Sun, 29 Mar 2009 01:09:13 +0000 (03:09 +0200)]
Add STRUC change to changes.src

15 years agoFR 2499968: structures with non-zero base offset
Victor van den Elzen [Fri, 27 Mar 2009 02:53:59 +0000 (03:53 +0100)]
FR 2499968: structures with non-zero base offset

Add an optional second argument to struc, document it and test it.
Also removed trailing whitespace in nasmdoc.src in the process.

15 years agodisasm: fix reversed REP vs REPNE in eatbyte()
H. Peter Anvin [Thu, 19 Mar 2009 13:52:07 +0000 (06:52 -0700)]
disasm: fix reversed REP vs REPNE in eatbyte()

F2 is REPNE, F3 is REP(E)

15 years agodisasm: when no instruction is found, consider a naked prefix
H. Peter Anvin [Thu, 19 Mar 2009 06:10:19 +0000 (23:10 -0700)]
disasm: when no instruction is found, consider a naked prefix

If we can't find a matching instruction, rather than printing it as a
"db" literal, consider first if we can disassemble it as a naked prefix.

15 years agoNASM 2.06rc8
H. Peter Anvin [Wed, 18 Mar 2009 23:21:45 +0000 (16:21 -0700)]
NASM 2.06rc8

15 years agooutcoff: BR 2685756: fix SAFESEH with an internal symbol
Andy Polyakov [Wed, 18 Mar 2009 21:49:23 +0000 (14:49 -0700)]
outcoff: BR 2685756: fix SAFESEH with an internal symbol

Fix the SAFESEH directive for the specific case of a symbol internal
to the program.  With the optimizer enabled, it would otherwise fail
unless the symbol is external.

15 years agooutelf32/64: fix uninitialized rbtree
Michael Scherer [Wed, 18 Mar 2009 21:26:29 +0000 (22:26 +0100)]
outelf32/64: fix uninitialized rbtree

Fix crash caused by uninitialised memory that lead to dangling pointer
in the rbtree. This can be seen by compiling zsnes 1.50, with a file
that define many symbols, such as fxemu2c.asm.

15 years agoBR 2690688: Fix opcodes for FMA instructions
H. Peter Anvin [Wed, 18 Mar 2009 01:26:47 +0000 (18:26 -0700)]
BR 2690688: Fix opcodes for FMA instructions

Two bugs with respect to the FMA instructions:
- the variant increment is supposed to be 0x10, not 0x01.
- the base opcode for scalar VFNMADD is 0x9d, not 0x9c

15 years agoAdd test from BR 2690688
H. Peter Anvin [Tue, 17 Mar 2009 23:18:41 +0000 (16:18 -0700)]
Add test from BR 2690688

Add the test case from BR 2690688 to the test collection.

15 years agoBR 2690688: add missing VFM instructions
H. Peter Anvin [Tue, 17 Mar 2009 23:13:10 +0000 (16:13 -0700)]
BR 2690688: add missing VFM instructions

The Perl script which auto-generated the VFM instructions had
incorrectly conflated the VEX.W and VEX.L bits, with the result that
only half the valid instructions were generated.

15 years agoBR 2689316: PEXTRQ requires REX.W
H. Peter Anvin [Mon, 16 Mar 2009 23:32:42 +0000 (16:32 -0700)]
BR 2689316: PEXTRQ requires REX.W

The PEXTRQ instruction requires a REX.W prefix.

15 years agogenfma: fix spelling of the VFNM instructions
H. Peter Anvin [Mon, 16 Mar 2009 18:51:07 +0000 (11:51 -0700)]
genfma: fix spelling of the VFNM instructions

Fix the spelling of the scalar VFNM instruction in genfma.pl, too,
just in case we need to pull this script out again...

15 years agoinsns.dat: fix VFNM instructions incorrectly spelled as VFMN
H. Peter Anvin [Mon, 16 Mar 2009 18:49:27 +0000 (11:49 -0700)]
insns.dat: fix VFNM instructions incorrectly spelled as VFMN

The scalar versions of the VFNM instructions had been incorrectly
spelled VFMN.

15 years agoNASM 2.06rc7
H. Peter Anvin [Sun, 15 Mar 2009 21:38:54 +0000 (14:38 -0700)]
NASM 2.06rc7

15 years agoBR 2672117: handle long lines for db/dw/etc.
H. Peter Anvin [Sun, 8 Mar 2009 05:54:31 +0000 (21:54 -0800)]
BR 2672117: handle long lines for db/dw/etc.

Handle long arrays on a single line in db/dw/etc.

15 years agoautoconf: detect the broken bool in OpenWatcom 1.8
H. Peter Anvin [Sun, 1 Mar 2009 21:57:40 +0000 (13:57 -0800)]
autoconf: detect the broken bool in OpenWatcom 1.8

OpenWatcom 1.8 has a C99 mode, which implements _Bool and
<stdbool.h>.  Unfortunately the implementation is broken, and doesn't
let _Bool be implicitly converted to integer (as required by the C99
spec).  Detect this case in autoconf.

15 years agoMost instruction codes are octal, so print errors that way too
H. Peter Anvin [Sun, 1 Mar 2009 08:22:16 +0000 (00:22 -0800)]
Most instruction codes are octal, so print errors that way too

Most of our instruction opcodes are written in octal.  Thus, it makes
sense to print them that way if we ever have an error message.

15 years agooptimization.asm: more sbyte tests
H. Peter Anvin [Fri, 27 Feb 2009 00:37:55 +0000 (16:37 -0800)]
optimization.asm: more sbyte tests

A few more sbyte optimization tests.

15 years agosbyte: optimization is OK if UNKNOWN isn't set
H. Peter Anvin [Fri, 27 Feb 2009 00:34:56 +0000 (16:34 -0800)]
sbyte: optimization is OK if UNKNOWN isn't set

We can optimize the sbytes if the UNKNOWN flag isn't set

15 years agooptimization.asm: add sbyte tests
H. Peter Anvin [Fri, 27 Feb 2009 00:34:07 +0000 (16:34 -0800)]
optimization.asm: add sbyte tests

15 years agoNASM 2.06rc6
H. Peter Anvin [Thu, 26 Feb 2009 22:58:06 +0000 (14:58 -0800)]
NASM 2.06rc6

15 years agoBR 2413265: don't pessimize displacements
H. Peter Anvin [Thu, 26 Feb 2009 22:48:03 +0000 (14:48 -0800)]
BR 2413265: don't pessimize displacements

Optimize displacements, don't pessimize them.  When running in the
optimizer, we always keep track of when a reference is forward.  That
doesn't mean it is unknown.

15 years agooptimization.asm: add EA optimization tests
H. Peter Anvin [Thu, 26 Feb 2009 22:47:17 +0000 (14:47 -0800)]
optimization.asm: add EA optimization tests

Add tests for EA optimizations

15 years agonasm.c: another readability cleanup
H. Peter Anvin [Thu, 26 Feb 2009 22:36:19 +0000 (14:36 -0800)]
nasm.c: another readability cleanup

Yet another change for readability

15 years agonasm.c: readability cleanup for seg:off parsing
H. Peter Anvin [Thu, 26 Feb 2009 22:34:48 +0000 (14:34 -0800)]
nasm.c: readability cleanup for seg:off parsing

The code to pick apart seg:off in nasm.c was virtually unreadable due
to mechanized line breaking.

15 years agoRename convergence.asm to optimization.asm
Victor van den Elzen [Wed, 25 Feb 2009 16:49:23 +0000 (17:49 +0100)]
Rename convergence.asm to optimization.asm

15 years agoDo not confuse segmentless adresses and unknown forward references
Victor van den Elzen [Wed, 25 Feb 2009 16:32:00 +0000 (17:32 +0100)]
Do not confuse segmentless adresses and unknown forward references

Also be optimistic with immediate forward references.

15 years agoAdd VPCLMUL instructions
H. Peter Anvin [Tue, 24 Feb 2009 02:27:29 +0000 (18:27 -0800)]
Add VPCLMUL instructions

15 years agoassemble: only be optimistic with NO_SEG if we're really in pass 1
H. Peter Anvin [Tue, 24 Feb 2009 01:51:25 +0000 (17:51 -0800)]
assemble: only be optimistic with NO_SEG if we're really in pass 1

Only be optimistic about the reachability of a symbol with NO_SEG if
we are truly in pass 1, i.e. it could possibly be just a forward
reference.  After we have done a single pass, if it is still NO_SEG,
then it is an absolute symbol and need to be treated as such.

15 years agoconvergence.asm: add test of jmp to an absolute address
H. Peter Anvin [Tue, 24 Feb 2009 01:47:25 +0000 (17:47 -0800)]
convergence.asm: add test of jmp to an absolute address

A JMP to an absolute address can't be short.  Thus, we must not try to
make it so.

15 years agoAdd test file for optimal convergence
Victor van den Elzen [Mon, 23 Feb 2009 04:16:35 +0000 (05:16 +0100)]
Add test file for optimal convergence

Some edge cases where starting with a long form
converges suboptimally.

15 years agoBR 2420167: jmp not always optimized
Victor van den Elzen [Mon, 23 Feb 2009 03:35:00 +0000 (04:35 +0100)]
BR 2420167: jmp not always optimized

Begin by assuming short jumps are possible to prevent suboptimal convergence.

15 years agoPCLMUL is apparently targeted for Westmere with the AES stuff
H. Peter Anvin [Sun, 22 Feb 2009 04:45:42 +0000 (20:45 -0800)]
PCLMUL is apparently targeted for Westmere with the AES stuff

The PCLMUL instruction is apparently targetted for Westmere.

15 years agoNASM 2.06rc5
H. Peter Anvin [Sun, 22 Feb 2009 03:02:58 +0000 (19:02 -0800)]
NASM 2.06rc5

15 years agoBR 2557903: fix disassembly of a set of SSE MOV* instructions
H. Peter Anvin [Sun, 22 Feb 2009 02:58:15 +0000 (18:58 -0800)]
BR 2557903: fix disassembly of a set of SSE MOV* instructions

Fix the disassembly of the alternate forms of register-register
MOVAPD, MOVDQA, MOVDQU, MOVQ, MOVSD, and MOVUPD.

NASM never generates these, but they would be disassembled
incorrectly.

15 years agoBR 2541252: Fix issues in insns.dat, mostly related to LZCNT and POPCNT
H. Peter Anvin [Sun, 22 Feb 2009 02:51:17 +0000 (18:51 -0800)]
BR 2541252: Fix issues in insns.dat, mostly related to LZCNT and POPCNT

Fix various flags on LZCNT and POPCNT, and fix a few instructions
tagged \360\332, which makes no sense.

15 years agochanges.src: document WAIT and %$$ fixes
H. Peter Anvin [Sun, 22 Feb 2009 02:26:20 +0000 (18:26 -0800)]
changes.src: document WAIT and %$$ fixes

15 years agoBR 2592476: Treat WAIT as a prefix even though it's really an instruction
H. Peter Anvin [Sun, 22 Feb 2009 02:22:56 +0000 (18:22 -0800)]
BR 2592476: Treat WAIT as a prefix even though it's really an instruction

WAIT is technically an instruction, but from an assembler standpoint
it behaves as if it had been a prefix.  In particular, it has to be
ordered *before* any real hardware prefixes.

15 years agobr704736: handle deep context-local macros
H. Peter Anvin [Sun, 22 Feb 2009 01:55:08 +0000 (17:55 -0800)]
br704736: handle deep context-local macros

The documentation says that constructs with %$...$foo can be used
to access macros from deeper in the context stack.  From what
I can tell, that has never actually worked, since we'd enter names
like %$foo into the context-local macro name table.  Instead, only
insert the tail of the macro name into the context-local table;
expand get_ctx to also return a pointer to the macro name proper;
this is rather straightforward since we'd usually save away that
name at the point get_ctx is called anyway.

15 years agonasmlib: make nasm_strcat() take const arguments
H. Peter Anvin [Sun, 22 Feb 2009 01:54:31 +0000 (17:54 -0800)]
nasmlib: make nasm_strcat() take const arguments

None of the strings passed to nasm_strcat() are modified, to
make them const.

15 years agooutelf32/64: remove align_str in favor of fwritezero()
H. Peter Anvin [Sun, 22 Feb 2009 01:27:51 +0000 (17:27 -0800)]
outelf32/64: remove align_str in favor of fwritezero()

Drop the use of yet another local all-zero buffer, align_str, in favor
of calling fwritezero().

15 years agooutbin: fix typo: "sections" not "section"
H. Peter Anvin [Sun, 22 Feb 2009 01:27:13 +0000 (17:27 -0800)]
outbin: fix typo: "sections" not "section"

Fix silly typo: the variable is "sections" not "section"...

15 years agoUnify all-zero buffers; add fwritezero()
H. Peter Anvin [Mon, 9 Feb 2009 10:03:33 +0000 (11:03 +0100)]
Unify all-zero buffers; add fwritezero()

We have a number of all-zero buffers in the code.  Put a single
all-zero buffer in nasmlib.c.  Additionally, add fwritezero()
which can be used to write an arbitrary number of all-zero bytes;
this prevents the situation where the all-zero buffer is simply
too small.

15 years agoBR 2611906: proper error message for start < origin
H. Peter Anvin [Sun, 22 Feb 2009 01:19:05 +0000 (17:19 -0800)]
BR 2611906: proper error message for start < origin

When a section other than .text has a start < origin, we would
segfault; fix that.

Furthermore, at bin_cleanup() we don't have usable file/line
information, so pass ERR_NOFILE to the error() function.  Perhaps less
than ideal, but better than printing a null pointer.

15 years agoNASM 2.06rc4
H. Peter Anvin [Sun, 22 Feb 2009 00:58:34 +0000 (16:58 -0800)]
NASM 2.06rc4

15 years agoFix opcode for VADDSUBPS; operands for VBLEND; add SSE for AES ops
H. Peter Anvin [Sun, 22 Feb 2009 00:56:52 +0000 (16:56 -0800)]
Fix opcode for VADDSUBPS; operands for VBLEND; add SSE for AES ops

Fix the opcode for VADDSUBPS
Fix the operands for VBLEND
Corrent the instruction flags for the AES ops (they're SSE)

15 years agoFMA instructions won't be in Sandy Bridge
H. Peter Anvin [Sun, 22 Feb 2009 00:43:48 +0000 (16:43 -0800)]
FMA instructions won't be in Sandy Bridge

The FMA instructions aren't scheduled for Sandy Bridge after all.
They will be "in a future processor", so create a placeholder for now.

15 years agoPerl script used to generate FMA instruction patterns
H. Peter Anvin [Wed, 18 Feb 2009 22:13:45 +0000 (14:13 -0800)]
Perl script used to generate FMA instruction patterns

Small perl script used to generate the FMA instruction patterns.  May
come in useful if the spec changes again.

15 years agochanges.src: document updated AVX specification
H. Peter Anvin [Wed, 18 Feb 2009 22:13:25 +0000 (14:13 -0800)]
changes.src: document updated AVX specification

15 years agoUpdate the VFMA* instructions per the AVX spec version 5
H. Peter Anvin [Wed, 18 Feb 2009 22:07:14 +0000 (14:07 -0800)]
Update the VFMA* instructions per the AVX spec version 5

Update the VFMA* instructions to match the AVX spec version 5.
Since these are highly regular, use a small Perl script to generate
the instruction patterns.

15 years agoinsns.dat: fix minor formatting anomalies
H. Peter Anvin [Wed, 18 Feb 2009 22:05:15 +0000 (14:05 -0800)]
insns.dat: fix minor formatting anomalies

Fix minor anomalies in insns.dat.

15 years agoinsns.pl: handle the new VEX.DDS flag per AVX spec version 5
H. Peter Anvin [Wed, 18 Feb 2009 22:04:02 +0000 (14:04 -0800)]
insns.pl: handle the new VEX.DDS flag per AVX spec version 5

The AVX spec version 5 introduces the new VEX.DDS flag; support it.

15 years agoBR 2593349: Move version message back to stdout
H. Peter Anvin [Fri, 13 Feb 2009 17:33:56 +0000 (09:33 -0800)]
BR 2593349: Move version message back to stdout

Checkin 4b9358928b114caaf34a69d6fdfd3b285b7a72cc changed the version
message from stdout to stderr, but:

a) doesn't motivate the change in the commit log;
b) bundles that with other changes;
c) is inconsistent with other programs;
d) was done by me and I can't remember any reason for it.

Hence conclude it was unintentional and therefore a bug.  Since this
commit was done after 2.05.01 no stable release has been affected.

15 years agoNASM 2.06rc3
H. Peter Anvin [Wed, 11 Feb 2009 18:54:59 +0000 (10:54 -0800)]
NASM 2.06rc3

15 years agoAllow global declaration after symbol definition
Charles Crayne [Thu, 29 Jan 2009 03:07:18 +0000 (19:07 -0800)]
Allow global declaration after symbol definition

This experimental feature needs to be tested for
all output formats which recognize global symbols.

15 years agoFix Bugs item #2537867
Charles Crayne [Tue, 27 Jan 2009 22:43:37 +0000 (14:43 -0800)]
Fix Bugs item #2537867

Module labels.c has code to issue error message when global
directive appears after symbol definition, but the test condition
was incorrectly punctuated.

15 years agoDocument the as86 ..start label
Soronel Haetir [Tue, 20 Jan 2009 02:27:11 +0000 (17:27 -0900)]
Document the as86 ..start label

I realized that a documentation change is required to inform users about the
addition of entry point support for the as86 format.  The following produces
reasonable output for .txt output, but I am blind and so can't check the
other formats as readily.

15 years agodoc: clean up the "String Manipulation in Macros" section
H. Peter Anvin [Mon, 19 Jan 2009 07:04:45 +0000 (23:04 -0800)]
doc: clean up the "String Manipulation in Macros" section

Minor cleanups to the "String Manipulation in Macros" section.

15 years agodoc: indent the time macro example
H. Peter Anvin [Mon, 19 Jan 2009 06:59:13 +0000 (22:59 -0800)]
doc: indent the time macro example

Indent the time macro example for ease of reading.

15 years agodoc: fix typo
H. Peter Anvin [Mon, 19 Jan 2009 06:55:53 +0000 (22:55 -0800)]
doc: fix typo

verson -> version

15 years agoMerge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm
H. Peter Anvin [Mon, 19 Jan 2009 06:55:33 +0000 (22:55 -0800)]
Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm

15 years agodoc: update the section on numeric constants
H. Peter Anvin [Mon, 19 Jan 2009 06:51:46 +0000 (22:51 -0800)]
doc: update the section on numeric constants

Update the section on numeric constants, and add a few more examples.

15 years agoGenerate warning for unknown section atributes
Charles Crayne [Sun, 18 Jan 2009 23:27:03 +0000 (15:27 -0800)]
Generate warning for unknown section atributes

Previously, the ELF backends silently ignored incorrect or unknown
attributes on section declarations, and therefore used default values
in cases where the user had make an error in attempting to specify
custom values.

15 years agoFix the [warning] directive
H. Peter Anvin [Mon, 5 Jan 2009 17:08:06 +0000 (09:08 -0800)]
Fix the [warning] directive

Fix multiple bugs in the [warning] directive:

- Only parsed on pass 1
- "-" was interpreted as "+"

15 years agooutas86: slight stylistic cleanups
H. Peter Anvin [Sun, 4 Jan 2009 01:56:41 +0000 (17:56 -0800)]
outas86: slight stylistic cleanups

Minor stylistic cleanups to previous patch.

15 years agoAdd entry point support to as86 backend
Soronel Haetir [Sun, 4 Jan 2009 01:21:52 +0000 (16:21 -0900)]
Add entry point support to as86 backend

I needed entry point support with the as86 format, and after looking through
the archives found a similar desire from someone in 2002.  For some reason
such a patch never made it into the code, even though the required flag
value is present, so I offer the a patch of my own.

I compared against what is done in the .obj format and the approaches are
quite similar which I hope will aid in its acceptability.  While I have
tested it extensively it does do the job asked, and I'm honestly not sure
what extensive testing of the change would look like.

15 years agoBR 2432826: Fix enforcement of the LONG bit
H. Peter Anvin [Tue, 30 Dec 2008 04:52:28 +0000 (20:52 -0800)]
BR 2432826: Fix enforcement of the LONG bit

Somewhere we lost the enforcement of the LONG bit, as opposed to
NOLONG.  Fix this in the most obvious way.

15 years agoBR 2413278: Nonoptimal forms of arithmetic instructions involving AX
H. Peter Anvin [Tue, 30 Dec 2008 03:58:36 +0000 (19:58 -0800)]
BR 2413278: Nonoptimal forms of arithmetic instructions involving AX

At some point, we lost the optimizations for the core arithmetic
operations involving AX.  Put them back.

15 years agochanges.src: document Mach-O alignment fix.
H. Peter Anvin [Tue, 23 Dec 2008 00:37:59 +0000 (16:37 -0800)]
changes.src: document Mach-O alignment fix.

15 years agoNASM 2.06rc2
H. Peter Anvin [Sat, 20 Dec 2008 00:48:07 +0000 (16:48 -0800)]
NASM 2.06rc2

15 years agoMach-O alignment fix
David DeHaven [Tue, 9 Dec 2008 08:18:43 +0000 (00:18 -0800)]
Mach-O alignment fix

Several projects have taken to using .text to store read-only data
when building on Mac OS X due to crashes in SSE code from the .rodata
section being mis-aligned. It seems there was a misunderstanding about
how ld/ld64 handles section alignment in outmacho.c so I wrote a patch
to fix it. I tested it against x264 git, modified it to use ".rodata
align=16" for the data section and use movdqa instructions (guaranteed
to crash when built with unpatched nasm) and it passed all tests in
its checkasm tool.

If you want more data I can provide, but it's late and I've had a
couple glasses of mulled wine :)

-DrD-

15 years agoBR 2413272: Warn about byte displacement overflow
Victor van den Elzen [Wed, 10 Dec 2008 12:04:58 +0000 (13:04 +0100)]
BR 2413272: Warn about byte displacement overflow

Remove the special case for single byte displacements,
which was already in out() anyway.

15 years agoNASM 2.06rc1
H. Peter Anvin [Sun, 30 Nov 2008 23:53:02 +0000 (15:53 -0800)]
NASM 2.06rc1

15 years agoELF: use rbtree for symbol searches
H. Peter Anvin [Fri, 7 Nov 2008 03:55:05 +0000 (19:55 -0800)]
ELF: use rbtree for symbol searches

Linear searches are evil, so use an llrbtree to search for symbols by
offset.  This doesn't change the preexisting behaviour that we only
look for global symbols.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agorbtree: drop "const" from search function
H. Peter Anvin [Fri, 7 Nov 2008 03:54:05 +0000 (19:54 -0800)]
rbtree: drop "const" from search function

Having the search argument and result be "const" is nice in theory,
but causes problems in practice.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agochanges.src: document POPCNT fix.
H. Peter Anvin [Thu, 6 Nov 2008 17:42:11 +0000 (09:42 -0800)]
changes.src: document POPCNT fix.

Add POPCNT fix to release notes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoMerge branch 'nasm-2.05.xx'
H. Peter Anvin [Thu, 6 Nov 2008 17:41:23 +0000 (09:41 -0800)]
Merge branch 'nasm-2.05.xx'

15 years agotest/popcnt.asm: simple test for the POPCNT instruction
H. Peter Anvin [Thu, 6 Nov 2008 17:40:39 +0000 (09:40 -0800)]
test/popcnt.asm: simple test for the POPCNT instruction

Very simple test of POPCNT instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoThe POPCNT instruction does not need sizes on memory operands
H. Peter Anvin [Thu, 6 Nov 2008 17:39:48 +0000 (09:39 -0800)]
The POPCNT instruction does not need sizes on memory operands

The POPCNT instruction should not require sizes on memory operands.
Add the appropriate size flags for that to work.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2229703: POPCNT r64,rm64 not POPCNT r64,rm32
H. Peter Anvin [Thu, 6 Nov 2008 17:35:02 +0000 (09:35 -0800)]
BR 2229703: POPCNT r64,rm64 not POPCNT r64,rm32

The 64-bit version of the POPCNT instruction takes r64,rm64; not
r64,rm32.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agopreproc: BR 2222615: fix segfault on bogus %ifmacro
H. Peter Anvin [Tue, 4 Nov 2008 22:24:34 +0000 (14:24 -0800)]
preproc: BR 2222615: fix segfault on bogus %ifmacro

BR 2222615: Fix segmentation fault on %ifmacro without an argument.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: better description of %line
H. Peter Anvin [Wed, 5 Nov 2008 23:55:40 +0000 (15:55 -0800)]
doc: better description of %line

The implication that %line allows NASM to digest cpp output is just
plain wrong, at least without additional intermediate processing.  Be
a little more circumspect.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoFix BR #916647
Victor van den Elzen [Wed, 5 Nov 2008 13:11:46 +0000 (14:11 +0100)]
Fix BR #916647

nasm.c should respect the default debug format of the output format,
instead of replacing it with the first format in the list.
This is cleaner and allows the list to be sorted normally.

This commit rewrites commit 116994111b which was very fragile.

15 years agochanges.src: document if for %ifmacro.
H. Peter Anvin [Tue, 4 Nov 2008 22:26:32 +0000 (14:26 -0800)]
changes.src: document if for %ifmacro.

Document fixed %ifmacro.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest: add test for BR 2222615
H. Peter Anvin [Tue, 4 Nov 2008 22:25:12 +0000 (14:25 -0800)]
test: add test for BR 2222615

Add a test for %ifmacro, per BR 2222615.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agopreproc: BR 2222615: fix segfault on bogus %ifmacro
H. Peter Anvin [Tue, 4 Nov 2008 22:24:34 +0000 (14:24 -0800)]
preproc: BR 2222615: fix segfault on bogus %ifmacro

BR 2222615: Fix segmentation fault on %ifmacro without an argument.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoPrevent erroneous extra "final" pass
Charles Crayne [Tue, 4 Nov 2008 02:21:24 +0000 (18:21 -0800)]
Prevent erroneous extra "final" pass

Specifically check for end of final pass.

15 years agodoc/changes.src: document ELF TLS
H. Peter Anvin [Mon, 3 Nov 2008 04:41:29 +0000 (20:41 -0800)]
doc/changes.src: document ELF TLS

Add ELF TLS to the release notes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: minor edit to the TLS documentation examples.
H. Peter Anvin [Mon, 3 Nov 2008 04:40:16 +0000 (20:40 -0800)]
doc: minor edit to the TLS documentation examples.

Minimize the TLS documentation examples (we don't need "dword" in a
mov from ebx, for example.)  This is just to avoid user confusion.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoDocument differences between TLS coding in ELF32 and ELF64
Charles Crayne [Sun, 2 Nov 2008 00:09:36 +0000 (17:09 -0700)]
Document differences between TLS coding in ELF32 and ELF64

Absolute relocation wrt ..tlsie for ELF32
Relative relocation wrt ..gottpoff for ELF64

15 years agoELF32 support for offset to IE GOT entry
Charles Crayne [Sat, 1 Nov 2008 23:48:31 +0000 (16:48 -0700)]
ELF32 support for offset to IE GOT entry

Add new WRT type ..tlsie.
Generate R_386_TLS_IE relocation entries
for references to thread local variables.

15 years agoversion.pl: snapshot releases *only* have digits in the tail
H. Peter Anvin [Sat, 1 Nov 2008 19:57:05 +0000 (12:57 -0700)]
version.pl: snapshot releases *only* have digits in the tail

Snapshot releases have *only* digits in the tail.  "git describe"
produces tails that have digits in them, but aren't numeric.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>