Bug 13126 - Out of address bound during thumb disassembly
Summary: Out of address bound during thumb disassembly
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.21
: P2 critical
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 04:49 UTC by ShivaKumar Jakkani
Modified: 2011-08-24 04:49 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ShivaKumar Jakkani 2011-08-24 04:49:23 UTC
Hi,

     I'm using Binutils for the cortex-m3 processor which is a thumb only processor. When I'm disassembling the code in thumb mode I'm getting a Address out of bound problems. 

Following is the code snippet for which I'm getting the issue.

============================================================================
.global __main
.section main   /* 0x10000000 */
.align 2
__main :
	ldr r0, = 0xFFF00000	/* Base address loaded in r0 register */
	ldr r1, [r0, #4] 	/* Post index modifier */
	ldr r2, [r0, #4] 	/* Post index modifier */
	ldr r3, [r0, #4] 	/* Post index modifier */
	ldr r4, [r0, #4] 	/* Post index modifier */
	ldr r5, [r0, #4] 	/* Post index modifier */
	ldr r6, [r0, #4] 	/* Post index modifier */
	mov r7, pc

Dissaembly through objdump in thumb mode
Disassembly of section main:

10000000 <main>:
10000000:       4804            ldr     r0, [pc, #16]   ; (0x10000014)
10000002:       6841            ldr     r1, [r0, #4]
10000004:       6842            ldr     r2, [r0, #4]
10000006:       6843            ldr     r3, [r0, #4]
10000008:       6844            ldr     r4, [r0, #4]
1000000a:       6845            ldr     r5, [r0, #4]
1000000c:       6846            ldr     r6, [r0, #4]
1000000e:       467f            mov     r7, pc
10000010:       e7fe            b.n     0x10000010
10000012:       0000            lsls    r0, r0, #0
10000014:       0000            lsls    r0, r0, #0
10000016:       Address 0x10000016 is out of bounds.

===========================================================================
    I'm only getting this issue when the address loaded in the first instruction is greater than or equal to 0xE80000000. I looked at the source code for disassembly and found that when ever any address is greater than 0xE8000000 it is thinking as a thumb-2 instruction and trying to dissamble which causes this address out of bound issues.

Please help me to fix this issue.

Thanks and Regards,
Shiva.