summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2013-05-03 12:22:11 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2013-05-03 12:22:11 +0000
commit90c9abdd272400e793a3fa1ddcb1d282cf32f618 (patch)
tree451bcd59589f9e20336441f4384e2ef00e2ebc44 /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
parent2f54d9fe10fb47613cc33536ad59f689592a5415 (diff)
downloadbcm5719-llvm-90c9abdd272400e793a3fa1ddcb1d282cf32f618.tar.gz
bcm5719-llvm-90c9abdd272400e793a3fa1ddcb1d282cf32f618.zip
[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. llvm-svn: 181010
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud