Commit Graph

1525 Commits

Author SHA1 Message Date
H. Peter Anvin
e8873121aa rbtree: drop the data pointer; instead rely on being embedded
Drop the data pointer, and instead assume the struct rbtree will be
embedded in a bigger data structure (to be extracted via
container_of()).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-30 10:58:28 -07:00
H. Peter Anvin
9656a581cd compiler.h: add offsetof() and container_of()
offsetof() is a C99 construct; provided here as an ersatz for older
systems.

container_of() is a nonstandard but highly useful construct, which
allows data structure control items like tree structures to be
embedded in larger data structures without the penalty of extra
pointers and allocations.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-30 10:54:55 -07:00
H. Peter Anvin
3e364fe274 Left-leaning red-black tree data structure
Implement library functions for "left-leaning red-black trees" with
uint64_t keys.  This is meant for looking up symbols by address in the
backends that need to do so, e.g. ELF.

A good question is if there is a better way to do this, that recovers
the original symbol, but that's a future issue.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 23:31:56 -07:00
H. Peter Anvin
034b009e51 Fix header guards for outlib.h
Fix typo in header guards for outlib.h

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 23:31:56 -07:00
H. Peter Anvin
5da04b035c make alldeps
Run "make alldeps"

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 21:03:17 -07:00
H. Peter Anvin
8321866bb5 doc: cross-reference macro parameter concatenation with %[...]
Explicitly document that %[...] and macro parameters concatenate the
same way, and cross-reference the two.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 21:02:30 -07:00
H. Peter Anvin
ad3d21fdb6 Merge branch 'nasm-2.05.xx' 2008-10-29 20:47:58 -07:00
H. Peter Anvin
79ced5ad36 doc: fix typo in the description of %unmacro
The description of %unmacro used %unmacro in a place which should
obviously have been %macro.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 20:47:47 -07:00
H. Peter Anvin
c84fa31d04 doc: fix capitalization
Make the capitalization of "The -t Option" consistent with the other
options.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 20:47:40 -07:00
H. Peter Anvin
3b142db39e doc: remove duplicate entry for the "error" warning class
Remove duplicate entry for the "error" warning class; leave at the end
with "all", as being another meta-warning class.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 20:47:32 -07:00
H. Peter Anvin
d37e5232b4 doc: retroactively document updates to the warning options
Retroactively document the following changes to the warning options:

  - gcc-like syntax (-Wfoo, -Wno-foo)
  - "all" alias
  - "error" metawarning

Added in 2.00rc1 but never documented.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 20:47:25 -07:00
H. Peter Anvin
6c9f6f8e3d doc: fix typo in the description of %unmacro
The description of %unmacro used %unmacro in a place which should
obviously have been %macro.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 20:46:30 -07:00
H. Peter Anvin
2d9ceaa3ee doc: fix capitalization
Make the capitalization of "The -t Option" consistent with the other
options.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 18:17:59 -07:00
H. Peter Anvin
b7aaf0b9e5 doc: remove duplicate entry for the "error" warning class
Remove duplicate entry for the "error" warning class; leave at the end
with "all", as being another meta-warning class.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 18:16:31 -07:00
H. Peter Anvin
8a2f145260 doc: retroactively document updates to the warning options
Retroactively document the following changes to the warning options:

  - gcc-like syntax (-Wfoo, -Wno-foo)
  - "all" alias
  - "error" metawarning

Added in 2.00rc1 but never documented.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 18:14:03 -07:00
H. Peter Anvin
fd366a9db4 Merge commit 'nasm-2.05.01'
Conflicts:
	doc/changes.src
2008-10-29 10:53:37 -07:00
H. Peter Anvin
32f58028da NASM 2.05.01 2008-10-29 10:52:53 -07:00
H. Peter Anvin
7714ced1d9 doc/changes.src: document -W/-w fix as a NASM 2.05.01 feature.
Make -W/-w fix a release note for NASM 2.05.01.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-29 10:51:51 -07:00
Charles Crayne
ea2c1f9b46 Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm 2008-10-27 22:54:38 -07:00
Charles Crayne
ee5245a9f2 Initial documentation for ELF64 TLS
More to come.
2008-10-27 22:53:40 -07:00
H. Peter Anvin
03c4f90afa output: add common file outlib.c for common functions; realsize()
Add a common file, outlib.c, for output formats.  Add the function
realsize() instead of open-coded variants in almost every backend.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-27 22:19:59 -07:00
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