Subject: Re: cross compile

From: Philip Blundell <[email-masked]>
Date: Wed, 14 May 1997 16:19:55 +0100 (BST)

On Wed, 14 May 1997, David Alan Gilbert wrote:

> in user mode on an ARM710 the results are probably undefined, but in practice
> it will probably survive and just not restore the flags.  So the net effect is
> that the code will survive but the flags will have changed over the course
> of the function.  Now I guess (but don't actually know) that there are fairly
> few places which actually depend on flags being preserved accross a procedure
> call so if your really lucky it will execte correctly. But it could
> just go wrong.

That's what I thought.  In that case we should possibly provide some
mechanism to stop people falling into this trap.  Subtle condition code
corruptions could cause some quite insidious bugs. 

> Now of course the catch here is that if the ARM710 is running full 26
> bit mode then it will quite happily execute the ARM3 code. Now I think
> Linux does that - but in that case things should becompiled with -m3. 

Oh, right.  I thought Linux ran everything in 32-bit mode if it could.  I
don't have an ARM6 machine here to try it on though.

p.

---

From: David Alan Gilbert <[email-masked]>
Date: Wed, 14 May 97 16:15:38 BST

> If I build a binary on an ARM3 machine (using -marm3) and try to run it on
> an ARM710, say, which of the following will it do?
> 
>  - work correctly
>  - silently go wrong
>  - refuse to execute

Good question! Lets ignore kernel code for a minute (because that definitly
would fail). If you exit a function with 

MOVS PC,R14

Now of course the catch here is that if the ARM710 is running full 26 bit mode
then it will quite happily execute the ARM3 code. Now I think Linux does that -
but in that case things should becompiled with -m3.

Dave