[arm-gnu] undefined instruction
Carlos O'Donell
carlos_odonell at mentor.com
Wed May 16 20:05:45 UTC 2012
On 5/16/2012 3:43 PM, Carlo Caione wrote:
> On Wed, May 16, 2012 at 1:04 AM, Carlos O'Donell
> <carlos_odonell at mentor.com> wrote:
>
>> What did you use to get this disassembly?
>
> arm-none-aebi-gdb in eclipse. Without eclipse is (obviously :) the same:
>
> (gdb) disassemble
> Dump of assembler code for function strlen:
> => 0x40205c84 <+0>: beq 0x40205d18 <memcpy>
> 0x40205c88 <+4>: ; <UNDEFINED> instruction: 0xf03fe03a
> 0x40205c8c <+8>: andeq r0, r0, r6
> 0x40205c90 <+12>: andeq r0, r0, r4
> 0x40205c94 <+16>: andeq r0, r0, r7
> 0x40205c98 <+20>: andeq r0, r0, sp, lsl r0
> 0x40205c9c <+24>: ldrdmi r0, [r0], -r3
> 0x40205ca0 <+28>: ; <UNDEFINED> instruction: 0xffffffff
> End of assembler dump.
Either gdb thinks this is wrong architecture/endian, or you didn't load anything and it's disassembling garbage from memory, or the probe is returning garbage for that memory location. You need to rule these out one at a time.
Switch to the gdb console and issue `show architecture', then issue `show endian', what does it show?
>> When you compile with -save-temps what does the output assembly look like before being assembled?
That looks good.
> This is the disassebly of the object file:
This looks good.
>> It might be that the mapping symbols are missing and your disassembling constant pool data.
>>
>> What are the .gnu_attribute flags for the object file?
>
> I don't have any flags (If I have correctly understood what you mean).
Run `*-readelf -Wa` on your file (there is an run external tool for this in the IDE), and provide the output of the "Attribute section"
e.g.
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "ARM7TDMI"
Tag_CPU_arch: v4T
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_FP_arch: VFPv2
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_enum_size: small
Tag_DIV_use: Not allowed
Cheers,
Carlos.
--
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell at mentor.com
carlos at codesourcery.com
+1 (613) 963 1026
More information about the arm-gnu
mailing list