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>
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>
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>
Explicitly document that %[...] and macro parameters concatenate the
same way, and cross-reference the two.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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>
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>
When issuing warnings for EA displacements during address generation,
actually look a the proper operand!
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
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>