Separate out function and function pointer attributes, as not all
versions of all compilers support both.
Have macros related to function attributes auto-generated by
autoheader. As a result, rename config.h.in to unconfig.h, to make it
more obvious that it is really intended to be included from some C
programs.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Encapsulate the list_options() encoding in an inline function. We only
ever compute a mask with a non-constant input in two places (command
line and pragma parsing), so a slightly more complex mapping is of no
consequence; thus map a-z, A-Z and 0-9 as being the most likely
characters we may want to use as options. Space is left for two more :)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add a %pragma to set (or clear) listing options. It only takes effect
on the next assembly pass, however!
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
When printing lines coming from %rep blocks and macros, show the line
number corresponding to the line actually being printed.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add an -L option for additional listing information. Currently
supported is -Le, which emits each line after processing through the
preprocessor, and -Lm, which displays each single-line macro defined
or undefined.
NASM doesn't preserve the names of unused arguments, nor does it have
any technical reason to do so. Instead of adding complexity to save
them, make unnamed parameters official by specifying an empty string
in the argument list.
This has the additional advantage that () is now simply considered a
single empty argument, which means that NASM should now properly
handle things like:
%define myreg() eax
mov edx,myreg()
... similar to how the C preprocessor allows an empty macro argument
list which is distinct from a macro with no arguments whatsoever.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
For constructs like TIMES xx RESB yy merge the TIMES and RESB and feed
a single reservation to the backend; this can (obviously) be
dramatically faster.
Add byte count in listings for <incbin> and repeat count to <rept>; to
make them more reasonable in length shorten to <bin ...> and <rep ...>
respectively, and don't require leading zeroes in bin/rep/res count.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Change the severity parameter to the error function from "int" to an
unsigned typedef, currently uint32_t.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
ERR_HERE is used to mark messages of the form "... here" so that we
can emit sane output to the list file with filename and line number,
instead of a nonsensical "here" which could point almost anywhere.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This provides the first pass of assembler internals for a new, richer,
backend interface. It also reduces the amount of data carried in
function parameters inside the assembler.
The new interface is in the form of a structure, which will contain
substantially more information that the previous interface. This will
allow things like ELF GOT32X and Mach-O X86_64_RELOC_BRANCH
relocations to be reliably emitted.
This provides the initial set of structures. Future additions should
include:
1. Pass down the base symbol, if any.
2. Segments should be a structure rather than a number, and the
horrible hack of adding one for a segment reference should be
removed (OUT_SEGMENT replaces it.)
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Make the source code easier to understand and keep track of by
organizing it into subdirectories depending on the function.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>