IP-relative relocations were broken for 32-bit Mach-O when referencing
external symbols after the Mach-O backends were merged.
This fixes bug reports 3392348, 3392352, and 3392346.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
The logic for suppressing preprocessor errors was missing an !, which
was present before checkin 215186fe82.
Reported-by: Knut St. Osmundsen <bird-nasm@anduin.net>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Per the MSVC++ docs, /Ox and /Oy are redundant with /O2, and the docs
recommend that they do not be used together.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Avoid funnies with ordering of debug format selection by deferring
debug format search until after command line processing. Also permit
the -gformat syntax used by many C compilers.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Get rid of the completely pointless "debuginfo" parameter to
ofmt->cleanup(). Most backends completely ignore it, and the two that
care (obj, ieee) can simply test dfmt instead.
Also, dfmt is never NULL, so any test for a NULL dfmt is bogus.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Document the label fix; although a global error, it was user-visible
in the Codeview backend so document it as such.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
Now when labels are properly concatenated in common code, there is no
reason for the debugging backend to need to be aware of local
symbols. We don't have to consider ..[^@] special symbols either, as
they are now filtered in labels.c.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Debugged-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
labels.c now filter ..[^@] special symbols from the debug backend,
so we don't have to open-code that everywhere.
In the actual output format, don't treat ..@ symbols as special.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
labels.c now filter ..[^@] special symbols from the debug backend, so
we don't have to open-code that everywhere.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
When a local label was seen, the debug backend would not receive the
full label name! In order to both simplify the code and avoid this
kind of discrepancy again, make both the output and debug format calls
from a common static function.
However, none of the current debug format backends want to see NASM
special symbols (that start with .. but not ..@) so filter those from
the debug backend.
Finally, fix an incorrect comment in nasm.h: the debug format is
called *after* the output format.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
For consistency with ofmt/dfmt, change the listing structure
to "struct lfmt" and "lfmt" and move it to listing.h.
From master branch commit 8ac25aa020
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Move ofmt->current_dfmt into a separate global variable. This
should allow us to make ofmt readonly and removes some additional
gratuitious differences between backends.
From master branch checkin a7bc15dd0a
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
We are supposed to handle compiling on a "C90 plus long long"
compiler, so make gcc (our most common development platform compiler)
complain when we don't.
However, suppress the complaints about the Microsoft definitions of
the <inttypes.h> strings.
From master branch checkin 25da6eaf43,
except that -Wwrite-strings is omitted; making the code base
-Wwrite-strings clean is going to take additional work.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
We can always operate correctly if neither WORDS_BIGENDIAN nor
WORDS_LITTLEENDIAN are defined, so if the word order is either
indeterminable or universal (the compiler generates both bigendian and
litteendian output from the same sources) then define neither.
From master branch checkin ef63588eb4
Resolved Conflicts:
configure.in
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
By default we setup @listname to '\0' and if has
not been specified in command line it is passed
in this form into list_init() which cause
| [cyrill@uranus nasm.git] ./nasm -felf64 t.asm
| nasm: error: unable to open listing file `'
So make a proper test here.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Make the NSIS output automatically select the output architecture to
generate the proper filename and, much more importantly, set up the
proper default install directory.
This requires Perl as well as makensis to be present in order to make
an installer, but that doesn't really seem like a too onerous of a
requirement (NSIS being the big external dependency here.)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Most preprocessor warnings are ERR_PASS1, but we want to see them in
the listing file too. If we make it to the code-generation pass,
ignore ERR_PASS* for the purpose of emitting warnings to the list
file.
While we are at it, allow ERR_DEBUG to specify ERR_PASS* too.
From master branch checkin 4a8d10c1a0
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Additional places where we can change ERR_PANIC and ERR_FATAL to
nasm_panic and nasm_fatal. Note that nasm_panic and nasm_fatal should
*aways* be expected to be fatal; they should never be used in a
suppressed context. It is critical that we verify that this doesn't
break anything.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
We pass around a whole bunch of function pointers in arguments,
which then just get stashed in static variables. Clean this mess
up and in particular handle the error management in the preprocessor
using nasm_set_verror() which already exists.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
From master branch checkin 130736c0cf
Resolved Conflicts:
nasm.c
preproc-nop.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Replace all instances of ERR_FATAL or ERR_PANIC with nasm_fatal or
nasm_panic so the compiler knows that these functions cannot return,
*and* we trigger abort() if we were to ever violate that constraint.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Just like nasm_panic(), nasm_fatal() tells the compiler that
we can never return from this call.
From master branch checkin bbbf508394
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
When we have to die due to an assertion violation, then show the
missing symbol. Also, use nasm_panic() rather than nasm_assert() for
this purpose.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
We probably ought to release 2.12.01 in the short term. So far the
changes that have accumulated have all been build fixes.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
autoconf's handling of --without and --disable are a bit
counterintuitive: instead of calling the "not given" branch of the
conditional, they instead call the "given" part of the conditional
with an argument of "no". Make --disable-werror work as expected.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Remove unused debugging functions, and the _unused macro which turned
out to cause compilation problems on Linux/PowerPC.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Look for WORDS_LITTLEENDIAN instead of the gcc-specific __BYTE_ORDER.
Use our existing "compiler.h" portability layer.
Make functions which are not exported static.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>