Fwd: gcc 4.4.0 arm/thumb interwork _from_arm bad stub generation

Started by Miguel Angel June 13, 2009
I sent this email to gcc-help, but may be somebody here had the
same problem before.

My GCC is generating broken "_from_arm" stubs sometimes in interworking mode.

Thanks in advance,
Miguel Angel.
---------- Forwarded message ----------
From: Miguel Angel
Date: 2009/6/13
Subject: gcc 4.4.0 arm/thumb interwork _from_arm bad stub generation
To: g...@gcc.gnu.org
Hello, I hope I'm writting to the right list,

I'm having a problem with gcc 4.4.0 cross compiler from IA32 to
ARM7TDMI in embedded
environments (newlib) with ARM/THUMB interworking.

Everything has worked fine in my tests until I tried to make use
of the libc, after
doing that, some parts of the "_from_arm" generated stubs for
interworking got broken/
overwritten/ ?? at linking time. Also the function attributes change
from "thunk" to "noreturn".

But it doesn't happen to all of the _from_arm stubs, only some of them.

If you have any hints about where to look to solve this it or whom
to ask , that would be great.

Thanks in advance,
Miguel Angel

Correctly generated (from main.elf)

.text:00003CA4 ; ---
.text:00003CAC 25 3C 00 00 off_3CAC DCD memcpy+1 ;
DATA XREF: __memcpy_from_arm r
.text:00003CAC ; End of function __memcpy_from_arm
.text:00003CAC
.text:00003CB0
.text:00003CB0 ; ---
.text:00003CB8 59 3B 00 00 off_3CB8 DCD __umodsi3+1 ;
DATA XREF: ____umodsi3_from_arm r
.text:00003CB8 ; End of function ____umodsi3_from_arm
.text:00003CB8
.text:00003CBC
.text:00003CBC ; ---
.text:00003CC4 CD 3A 00 00 off_3CC4 DCD __udivsi3+1 ;
DATA XREF: ____udivsi3_from_arm r
.text:00003CC4 ; End of function ____udivsi3_from_arm
.text:00003CC4
Incorrectly generated (from main.elf)
.text:0000514C ;

An Engineer's Guide to the LPC2100 Series

The problem is fixed now.

For reference: I was using 2.19.1, after updating to 2.19.51 the ARM
interworking link bugs disappeared.

Greetings,
Miguel Angel.

2009/6/13 Miguel Angel :
> I sent this email to gcc-help, but may be somebody here had the
> same problem before.
>
> My GCC is generating broken "_from_arm" stubs sometimes in interworking mode.
>
> Thanks in advance,
> Miguel Angel.
> ---------- Forwarded message ----------
> From: Miguel Angel
> Date: 2009/6/13
> Subject: gcc 4.4.0 arm/thumb interwork _from_arm bad stub generation
> To: g...@gcc.gnu.org
> Hello, I hope I'm writting to the right list,
>
> I'm having a problem with gcc 4.4.0 cross compiler from IA32 to
> ARM7TDMI in embedded
> environments (newlib) with ARM/THUMB interworking.
>
> Everything has worked fine in my tests until I tried to make use
> of the libc, after
> doing that, some parts of the "_from_arm" generated stubs for
> interworking got broken/
> overwritten/ ?? at linking time. Also the function attributes change
> from "thunk" to "noreturn".
>
> But it doesn't happen to all of the _from_arm stubs, only some of them.
>
> If you have any hints about where to look to solve this it or whom
> to ask , that would be great.
>
> Thanks in advance,
> Miguel Angel
>
> Correctly generated (from main.elf)
>
> .text:00003CA4 ; ---
> .text:00003CAC 25 3C 00 00 off_3CAC DCD memcpy+1 ;
> DATA XREF: __memcpy_from_arm r
> .text:00003CAC ; End of function __memcpy_from_arm
> .text:00003CAC
> .text:00003CB0
> .text:00003CB0 ; ---
> .text:00003CB8 59 3B 00 00 off_3CB8 DCD __umodsi3+1 ;
> DATA XREF: ____umodsi3_from_arm r
> .text:00003CB8 ; End of function ____umodsi3_from_arm
> .text:00003CB8
> .text:00003CBC
> .text:00003CBC ; ---
> .text:00003CC4 CD 3A 00 00 off_3CC4 DCD __udivsi3+1 ;
> DATA XREF: ____udivsi3_from_arm r
> .text:00003CC4 ; End of function ____udivsi3_from_arm
> .text:00003CC4
> Incorrectly generated (from main.elf)
> .text:0000514C ;