This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [uClinux-dev] why no-mmu cannot support binfmt_aout.c
- From: loody <miloody at gmail dot com>
- To: Jamie Lokier <jamie at shareable dot org>
- Cc: uClinux development list <uclinux-dev at uclinux dot org>, gcc-help <gcc-help at gcc dot gnu dot org>, binutils at sourceware dot org
- Date: Thu, 29 Jan 2009 15:08:15 +0800
- Subject: Re: [uClinux-dev] why no-mmu cannot support binfmt_aout.c
- References: <497CF332.5020206@snapgear.com> <20090126235125.GC9296@shareable.org> <3a665c760901270902r582c60dfm2668a30c754aaf17@mail.gmail.com> <20090127183339.GA23412@shareable.org> <3a665c760901281016i562c8f6h36e77d72946bc704@mail.gmail.com> <4980EE0E.9040307@snapgear.com> <3a665c760901281600q19a5d0d2n4c4bb321cdbfba6c@mail.gmail.com> <4980F5C8.3040202@snapgear.com> <3a665c760901282207g5e203ef0rfbd51a1c2c9a80a9@mail.gmail.com> <20090129061215.GD19270@shareable.org>
2009/1/29 Jamie Lokier <jamie@shareable.org>:
> loody wrote:
>> e1a0e00f mov lr, pc
>> e12fff13 bx r3
>
>> What is the specialty of the instruction, "mov lr,pc", which let
>> arm cpu fail?
>
> Both of those instructions can put the CPU into Thumb mode. If it
> doesn't support Thumb, you get an instruction fault.
>
> "mov lr,pc" is supported on all ARMs, but (guessing from what you're
> getting) maybe it can fault depending on the value in "lr"?
Hi:
I cannot understand the meaning of depending the value in "lr"?
Actually my cpu get exception when executing this instruction not bx r3.
But lr is the destination for cpu to write, I have checked the arm
reference and it doesn't say any cautions when the destination is lr.
>
> "bx" is not available on all ARMs, and will fault when you don't have
> it. That's why it's necessary to build everything with the right GCC
> options.
There are bx instructions generated when I use arm-linux-2006.
I list them below:
800096a0 <__kuser_helper_start>:
800096a0: e12fff1e bx lr
...
800096c0 <__kuser_cmpxchg>:
800096c0: e3e00000 mvn r0, #0 ; 0x0
800096c4: e2900000 adds r0, r0, #0 ; 0x0
800096c8: e12fff1e bx lr
...
800096e0 <__kuser_get_tls>:
800096e0: ee1d0f70 mrc 15, 0, r0, cr13, cr0, {3}
800096e4: e12fff1e bx lr
BTW, can I take off the Thumb support in my compiler options?
Thumb is only used for decreasing the density of source code and so
far I just want my kernel say hello to me.
appreciate your help,
miloody