m68k setjmp()
Jes Sorensen
jes@trained-monkey.org
Mon Oct 15 13:24:00 GMT 2001
Hi
I am having a problem with setjmp() on the m68k when compiling binaries
with -fomit-frame-pointere. I realized it's due to the fact that the
current implementation relying on being able to mangle the stack pointer
with the callee handling that:
Is that a reasonable requirement to say that setjmp() just doesn't work
when compiled with -fomit-frame-pointer?
If not, it seems that the way to solve the problem is to change the
implementation of setjmp() and _setjmp() to do the work rather than
relying on them calling __sigsetjmp().
Comments?
Thanks,
Jes
#ifdef MOTOROLA_SYNTAX
#define d0 %d0
#define d1 %d1
#define PUSH(reg) move.l reg, -(%sp)
#define POP(reg) move.l (%sp)+, reg
#define PUSH0 clr.l -(%sp)
#else
#define PUSH(reg) movel reg, sp@-
#define POP(reg) movel sp@+, reg
#define PUSH0 clrl sp@-
#endif
ENTRY (_setjmp)
POP (d0) /* Pop return PC. */
POP (d1) /* Pop jmp_buf argument. */
PUSH0 /* Push second argument of zero. */
PUSH (d1) /* Push back first argument. */
PUSH (d0) /* Push back return PC. */
#ifdef PIC
bra.l C_SYMBOL_NAME (__sigsetjmp@PLTPC)
#else
jmp C_SYMBOL_NAME (__sigsetjmp)
#endif
END (_setjmp)
More information about the Libc-hacker
mailing list