This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How to disable noreturn optimization for abort function? to avoid useless core
- From: Shankar Bandal <shankar dot bandal at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 4 Jul 2009 14:05:59 +0530
- Subject: How to disable noreturn optimization for abort function? to avoid useless core
Hi,
Need workaround/remedy to disable GCC noreturn type optimization for
abort to get useful coredump in abort () crash
I have build libc 2.5 with "-fno-omit-frame-pointer
-fno-optimize-sibling-calls -fno-builtin-abort -fno-crossjumping -O2 "
using gcc 4.2.1. But
still core genrated on abort call is useless.
I went through thread
http://sourceware.org/bugzilla/show_bug.cgi?id=3D6522but could get much
out of it.
when i disassembled libc with objdump, I can see fp is NOT stored
0002ba10 <atoll>:
2ba10: e92d4800 push {fp, lr}
2ba14: e3a01000 mov r1, #0 ; 0x0
2ba18: e28db004 add fp, sp, #4 ; 0x4
2ba1c: e3a0200a mov r2, #10 ; 0xa
2ba20: e1a03001 mov r3, r1
2ba24: eb000c4b bl 2eb58 <__strtoll_internal>
2ba28: e8bd8800 pop {fp, pc}
0002ba2c <abort>:
2ba2c: e59f8390 ldr r8, [pc, #912] ; 2bdc4 <abort+0x398>
2ba30: e59fa390 ldr sl, [pc, #912] ; 2bdc8 <abort+0x39c>
2ba34: e24db004 sub fp, sp, #4 ; 0x4
2ba38: e08f8008 add r8, pc, r8
2ba3c: e24dde11 sub sp, sp, #272 ; 0x110
2ba40: e088300a add r3, r8, sl
2ba44: e5932008 ldr r2, [r3, #8]
2ba48: ebffa4a8 bl 14cf0 <__aeabi_read_tp>
Am I missing something?
Shankar