llvm-6502/lib
Ulrich Weigand 3ea50a69d7 [SystemZ] Support System Z as host architecture
The llvm::sys::AddSignalHandler function (as well as related routines) in
lib/Support/Unix/Signals.inc currently registers a signal handler routine
via "sigaction".  When this handler is called due to a SIGSEGV, SIGILL or
similar signal, it will show a stack backtrace, deactivate the handler,
and then simply return to the operating system.  The intent is that the
OS will now retry execution at the same location as before, which ought
to again trigger the same error condition and cause the same signal to be
delivered again.  Since the hander is now deactivated, the OS will take
its default action (usually, terminate the program and possibly create
a core dump).

However, this method doesn't work reliably on System Z:  With certain
signals (namely SIGILL, SIGFPE, and SIGTRAP), the program counter stored
by the kernel on the signal stack frame (which is the location where
execution will resume) is not the instruction that triggered the fault,
but then instruction *after it*.  When the LLVM signal handler simply
returns to the kernel, execution will then resume at *that* address,
which will not trigger the problem again, but simply go on and execute
potentially unrelated code leading to random errors afterwards.

To fix this, the patch simply goes and re-raises the signal in question
directly from the handler instead of returning from it.  This is done
only on System Z and only for those signals that have this particular
problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181010 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03 12:22:11 +00:00
..
Analysis This patch breaks up Wrap.h so that it does not have to include all of 2013-05-01 20:59:00 +00:00
Archive Fix auto_ptr is deprecated warnings 2013-02-26 21:20:35 +00:00
AsmParser Fix for PR 14965: Better error message for GEP with partially defined contents 2013-04-22 17:03:42 +00:00
Bitcode This patch breaks up Wrap.h so that it does not have to include all of 2013-05-01 20:59:00 +00:00
CodeGen TiedTo flag can now be placed on implicit operands. isTwoAddrUse() should look 2013-05-02 02:07:32 +00:00
DebugInfo Clarify getRelocationAddress x getRelocationOffset a bit. 2013-04-25 12:28:45 +00:00
ExecutionEngine This exposes more MCJIT options via the C API: 2013-05-01 22:58:00 +00:00
IR This patch breaks up Wrap.h so that it does not have to include all of 2013-05-01 20:59:00 +00:00
IRReader Measure time that IR parsing took as part of the -time-passes measurement. 2013-04-03 15:33:45 +00:00
Linker This patch breaks up Wrap.h so that it does not have to include all of 2013-05-01 20:59:00 +00:00
MC Fix section relocation for SECTIONREL32 with immediate offset. 2013-04-25 19:27:05 +00:00
Object This patch breaks up Wrap.h so that it does not have to include all of 2013-05-01 20:59:00 +00:00
Option
Support [SystemZ] Support System Z as host architecture 2013-05-03 12:22:11 +00:00
TableGen Allow TableGen DAG arguments to be just a name. 2013-03-24 19:36:51 +00:00
Target Add support for reading ARM ELF build attributes. 2013-05-03 11:36:35 +00:00
Transforms [GV] Remove dead code which is really difficult to decipher. 2013-05-02 21:14:31 +00:00
CMakeLists.txt Split out the IRReader header and the utility functions it provides into 2013-03-26 02:25:37 +00:00
LLVMBuild.txt Split out the IRReader header and the utility functions it provides into 2013-03-26 02:25:37 +00:00
Makefile Split out the IRReader header and the utility functions it provides into 2013-03-26 02:25:37 +00:00