Weird issues. Linker + arm/thumb interworking / stub is not implemented.

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Weird issues. Linker + arm/thumb interworking / stub is not implemented.

Sylvain Becker
Hi,

This may not be the correct mailing list for this question.

My cross-compilation chain for ARM/THUMB for xscale doesn't behave
correctly during linking step. (use gcc-3.4.3 / glibc-2.3.3 /
binutils-2.15 / linux-2.6.10 ).

This file is built for ARM with -mthumb-interwork:

int main(){
  thumb_call();
  return 0;
}

This one, in Thumb with -mthumb-interwork:
void thumb_call(){
 int x=0;
 x++;
}

Each object dump seems correct.
It links without warning/errors.

But the executable contains something wrong:
main() call a "stub" function:  "thumb_call_FROM_ARM" which should
take care of the interworking, specially switching from ARM to Thumb
and jumping to "thumb_call".
This stub is actually empty, and since, it's at the end of the object,
the programm exits "correctly".

Problem doesn't appear, if I ask GCC to ask a static linking (-static
-static-libc),
because _thumb_call_FROM_ARM is be implemented correctly.

My question aims at somebody who would have encounter that kind of problem.
Maybe just a problem while rebuilding toolchain. (options were:
softfloat/interworking/xscale/).

Thanks for any help,

Sylvain Becker
Reply | Threaded
Open this post in threaded view
|

Re: Weird issues. Linker + arm/thumb interworking / stub is not implemented.

Daniel Jacobowitz-2
On Sun, Jun 19, 2005 at 08:32:24PM +0200, Sylvain Becker wrote:
> Hi,
>
> This may not be the correct mailing list for this question.
>
> My cross-compilation chain for ARM/THUMB for xscale doesn't behave
> correctly during linking step. (use gcc-3.4.3 / glibc-2.3.3 /
> binutils-2.15 / linux-2.6.10 ).

Binutils 2.15 did not support dynamic linking for Thumb.  Try a newer
version.

Glibc 2.3.3 doesn't support interworking with Thumb, either.

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: Weird issues. Linker + arm/thumb interworking / stub is not implemented.

Sylvain Becker
Ok thanks. It makes sense.
I can't see anything in the log/news.
Do you know whether any version has this feature?

Best regards,

Sylvain

On 6/19/05, Daniel Jacobowitz <[hidden email]> wrote:

> On Sun, Jun 19, 2005 at 08:32:24PM +0200, Sylvain Becker wrote:
> > Hi,
> >
> > This may not be the correct mailing list for this question.
> >
> > My cross-compilation chain for ARM/THUMB for xscale doesn't behave
> > correctly during linking step. (use gcc-3.4.3 / glibc-2.3.3 /
> > binutils-2.15 / linux-2.6.10 ).
>
> Binutils 2.15 did not support dynamic linking for Thumb.  Try a newer
> version.
>
> Glibc 2.3.3 doesn't support interworking with Thumb, either.
>
> --
> Daniel Jacobowitz
> CodeSourcery, LLC
>


--
Sylvain Becker
Reply | Threaded
Open this post in threaded view
|

Re: Weird issues. Linker + arm/thumb interworking / stub is not implemented.

Sylvain Becker
Hi,

Gnu Linker seems not to implement thumb interworking stubs when using
dynamic linking.
I have looked one the log/news of binutils, but can't find the information.

Does anyone know which version of Binutils support dynamic linking for Thumb?
Thank you and best regards,

Sylvain Becker.
Reply | Threaded
Open this post in threaded view
|

Re: Weird issues. Linker + arm/thumb interworking / stub is not implemented.

Daniel Jacobowitz-2
On Mon, Jun 20, 2005 at 11:31:59AM +0200, Sylvain Becker wrote:
> Hi,
>
> Gnu Linker seems not to implement thumb interworking stubs when using
> dynamic linking.
> I have looked one the log/news of binutils, but can't find the information.
>
> Does anyone know which version of Binutils support dynamic linking for Thumb?
> Thank you and best regards,

Have you tried the current release?

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: Weird issues. Linker + arm/thumb interworking / stub is not implemented.

Sylvain Becker
Hi,

Yes, with 2.16.1, -mthumb-interwork is fine.

Though, something still weird with binutils 2.15, or maybe my toolchain:

linker is called thought gcc, with:
arm-linux-ld -dynamic-linker /lib/ld-linux.so.2 -X -m armelf_linux -p
-o _a.out /usr/local/arm-linux/lib/gcc-lib/arm-linux/3.2.1/../../../../arm-linux/lib/crt1.o
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.2.1/../../../../arm-linux/lib/crti.o
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.2.1/crtbegin.o
-L/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.2.1
-L/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.2.1/../../../../arm-linux/lib
_arm.o _thumb.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.2.1/crtend.o
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.2.1/../../../../arm-linux/lib/crtn.o

if I just do:
arm-linux-ld -dynamic-linker /lib/ld.so.-mthumb-interwork _arm.o _thumb.o  
has actually implemented the interworking!

I am not trying to investigate anymore since binutils 2.16.1 is ok,
Thanks you,

Sylvain
 
//sorry: it's not the version of gcc I said, but it was the same with
another toolchain


On 6/20/05, Daniel Jacobowitz <[hidden email]> wrote:

> On Mon, Jun 20, 2005 at 11:31:59AM +0200, Sylvain Becker wrote:
> > Hi,
> >
> > Gnu Linker seems not to implement thumb interworking stubs when using
> > dynamic linking.
> > I have looked one the log/news of binutils, but can't find the information.
> >
> > Does anyone know which version of Binutils support dynamic linking for Thumb?
> > Thank you and best regards,
>
> Have you tried the current release?
>
> --
> Daniel Jacobowitz
> CodeSourcery, LLC
>


--
Sylvain Becker
Reply | Threaded
Open this post in threaded view
|

Re: Weird issues. Linker + arm/thumb interworking / stub is not implemented.

Daniel Jacobowitz-2
On Mon, Jun 20, 2005 at 04:08:42PM +0200, Sylvain Becker wrote:
> if I just do:
> arm-linux-ld -dynamic-linker /lib/ld.so.-mthumb-interwork _arm.o _thumb.o  
> has actually implemented the interworking!

That's because this is not a dynamic linked output file.

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: Weird issues. Linker + arm/thumb interworking / stub is not implemented.

Sylvain Becker
yes, sorry for the last mail :/
Thanks,

Sylvain


On 6/20/05, Daniel Jacobowitz <[hidden email]> wrote:

> On Mon, Jun 20, 2005 at 04:08:42PM +0200, Sylvain Becker wrote:
> > if I just do:
> > arm-linux-ld -dynamic-linker /lib/ld.so.-mthumb-interwork _arm.o _thumb.o
> > has actually implemented the interworking!
>
> That's because this is not a dynamic linked output file.
>
> --
> Daniel Jacobowitz
> CodeSourcery, LLC
>


--
Sylvain Becker