This is the mail archive of the
mailing list for the binutils project.
Re: b[l]x instruction in cortex-m3 code
- From: Daniel Jacobowitz <drow at false dot org>
- To: Daniel Otte <daniel dot otte at rub dot de>
- Cc: binutils at sourceware dot org
- Date: Mon, 18 Jul 2011 16:49:59 -0400
- Subject: Re: b[l]x instruction in cortex-m3 code
- References: <4E249174.email@example.com>
On Mon, Jul 18, 2011 at 4:03 PM, Daniel Otte <firstname.lastname@example.org> wrote:
> when I link code for the ARM Cortex-M3 the b[l]x instruction is emitted.
> Since Cortex-M3 has no ARM mode and no b[l]x instruction the CPU goes in a fault
> mode when it is asked to execute it.
> As far as I have read it is ok for the compiler to emit b[l]x but the linker is
> required to translate it into b[l] instructions.
> I tried a lot of linker flags with no success.
Typically this means you are calling a function that is not correctly
marked as Thumb code, so the linker is helpfully switching you back to
ARM mode; check the target symbol.