Store the original stack pointer (on entry to the syscall dispatcher)
in syscall_frame; the stack pointer itself is incremented by
"pop {r0-r3}" right before calling the syscall itself.
This fixes unwinding from functions set up by syscalls, like
KiUserExceptionDispatcher.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This differs slightly from the official docs (which is clear in some
places, vague in others, and contradictory in some places), based
on actual observed behaviour.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This isn't mentioned in the documentation (which only writes out the
instruction that is executed while unwinding, i.e. the mirror form of
it), but a prologue version of this instruction would look like this.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
b1fe783ade fixed relay entry points
in Thumb mode when assembled with Clang/LLVM in ELF mode, but broke
them when assembled with binutils as (and PE mode with LLVM didn't
work either before or after).
When/where the thumb bit is applied on symbols varies a lot between
assemblers; this is a notoriously vague and undocumented area.
After a .thumb_func directive, binutils as considers the next
non-local symbol as a thumb symbol, to have the thumb bit set.
LLVM's built-in assembler considers the next symbol, local or not,
to be a thumb symbol. (Just noting for reference for possible
solutions, this particular difference didn't play a role so far.)
Secondly, in a symbol difference expression like this:
.long symbol1 - symbol2
Binutils as ignores the potential thumb state for both symbols and
just calculates the raw distance. LLVM does include the thumb bit
in symbol1 but ignores it in symbol2.
Finally, for PE targets, the linker sets the thumb bit on all
absolute addresses pointing to the text section, regardless of any
.thumb_func directives at assembly time. (I.e., the
__wine_spec_relay_entry_points entry in .L__wine_spec_relay_descr
gets the bit set even if it wasn't marked as .thumb_func.)
Therefore, mark __wine_spec_relay_entry_points as .thumb_func, as
the absolute address to it will end up with the thumb bit set in
PE builds in any case.
Don't mark the individual relay entry pointers as thumb functions
(the code still is generated as thumb as there hasn't been any
mode switch back to arm mode); this makes the differences calculated
correctly (both LLVM and binutils ignore the thumb state of the
subtracted label).
If desired, one could change __wine_spec_relay_entry_point_%d into
local labels with a .L prefix, just as before
b1fe783ade again, it doesn't make
any difference in this form.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This has the side effect of fixing the build on macOS after
commit 2c1b815363.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Unlike most of the other wrc error functions, error() does not append a
trailing linefeed.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
It is not considered worthwhile freeing memory in short-lived
programs
Signed-off-by: David Kahurani <k.kahurani@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Just like we do for other targets with cross compiler enabled. Fixes
PE-only i686 build with llvm-mingw, which otherwise uses unexpected
optimizations.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>