This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add unwind information for ARM div0 and interworking stubs


On Fri, 2005-05-13 at 22:34, Daniel Jacobowitz wrote:
> This patch got a little larger than I expected...
> 
> The original problem I wanted to solve was that when you divide by zero on
> arm-linux, GDB can not backtrace from the point where the signal is raised.
> This is because of the stack frame created at the end of __divsi3; the
> function is otherwise frameless, so GDB assumes that lr is not on the stack.
> The only way to fix this is to provide an appropriate .debug_frame.
> 
> The gas cfi directives are not useful for this.  They create a .eh_frame
> section, instead of a .debug_frame section; we don't need the extra bytes
> in an allocated section on ARM.  It would be nice if gas supported geerating
> .debug_frame instead of .eh_frame at some point.
> 
> While I was there, I noticed a couple minor problems in this file:
>   - The interworking stubs and division routines call out with a
>     non-doubleword-aligned stack.
>   - The GNU/Linux div0 handler raises a signal by sys_kill, but if
>     sys_tkill is available, we should use that.  Otherwise a random
>     thread is going to receive the signal (in NPTL).  Ditto gettid
>     versus getpid.
> 
> Tested on arm-elf simulator, and by hand on arm-linux and arm-elf.  I
> checked backtraces from div0 on arm-elf ARM, arm-elf Thumb, and arm-linux. 
> I checked backtraces through _arm_return using -mcaller-super-interworking.
> I checked behavior of the tkill changes when gettid or tkill returns ENOSYS.
> 
> Is this OK?

Is sys_tkill available even if NPTL is not?  If so, then OK.

R.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]