http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54272

--- Comment #2 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-08-16 
11:23:42 UTC ---
(In reply to comment #1)

For linux environment, libc's abort function is a rather complex
function and trapa handler should do equivalent things to keep
complete binary compatibility.  I guess that it isn't worth to do
so.  You can introduce simple trapa sequence as an ABI changing -m
option on linux, though trap numbers < 32 are allocated for the
syscalls and all other numbers are given for debug purposes and
generate SIGTRAP with modified pc which points to trapa instruction
itself.  If the user program uses its own SIGTRAP handlers, this
might be problematic.  Perhaps the "sleep" instruction will be
a candidate because current libc uses it for ABORT_INSTRUCTION,
though it would be bad for bare metal cases.
BTW, there is a known SH4 core bug for trapa instruction and we
are using 5 or r0,r0 instructions just after trapa.  See libitm/
config/sh/futex_bits.h for example.

Reply via email to