This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: ARM/thumb interworking confuses unwinder


Thanks for the reply Christophe,

Christophe LYON wrote:
>> binutils 2.18 generates this, which works because lr does not get frobbed
>> and is obviously more efficient anyway as both here and with CVS, the
>> destination is within the 22-bit thumb branch limit):
>> 0x20058568 <___Unwind_RaiseException_from_thumb+0>:     bx      pc
>> 0x2005856a <___Unwind_RaiseException_from_thumb+2>:     nop
>> 0x2005856c <___Unwind_RaiseException_change_to_arm>:    b      
>> 0x20052918
>> <___Unwind_RaiseException>
>>
>> The problem originates with this change, checked in on 2008-05-15 or so:
>> http://sourceware.org/ml/binutils/2008-04/msg00423.html
>>
>> So the first issue is: why is this generating a long call stub in the
>> first place? [snip]
> 
> I think I should have added another stub (the one you used to have). I
> missed the case your are facing, sorry.

Does that mean that the other code generating stubs in
elf32_thumb_to_arm_stub() is redundant and thus obsolete?

> I am away for about a week, so if you can wait for a few days, I'll
> propose a fix when I am back.

I think I'll just see if I can revert to a snapshot date prior to 2008-05-15.

>> The second issue is that the long call stub can never work with C++
>> exceptions in GCC, at least for ARM EABI, and possibly the standard dwarf
>> unwinder as well. So if a call _was_ too far away for a simple stub, then
>> it would go wrong.
> 
> There are other stubs that can use 'lr' (eg plt ones, and
> non-interworking aware ones). How do they deal with this issue?

Good question. Perhaps I should have more precisely said "can never work
with C++ exceptions as currently implemented in GCC". It's possible that
GCC's ARM EABI unwinder needs fixing. CodeSourcery did that work. Paging
Daniel Jacobowitz... :-).

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine


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