Re: [arm-gnu] Unsupported instruction blx(1) generated in Cortex-M3 binary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] Unsupported instruction blx(1) generated in Cortex-M3 binary



On Mon, Jan 19, 2009 at 12:23:00PM -0800, Jeff J.Q. Liu wrote:
> Hi,
> 
> An illegal instruction "blx <symbol-address>" is generated in my Cortex-M3 standalone executable if the symbol is only defined in the linker script. Does someone know the fix or any workaround?

Hi Jeff,

Thanks for the report.  I don't think there's any way to define Thumb
functions in a linker script at present; I've opened an internal
enhancement request about this.

There's a simple workaround, though; define the function in an
assembly file as an absolute symbol:

        .type foo, %function
        .globl foo
        foo = 0x808001

The difference is that linker script symbols are marked as 'no type',
which is treated similar to a data object; the above marks foo as a
function.

-- 
Daniel Jacobowitz
CodeSourcery