http://sourceware.org/bugzilla/show_bug.cgi?id=13126
Bug #: 13126
Summary: Out of address bound during thumb disassembly
Product: binutils
Version: 2.21
Status: NEW
Severity: critical
Priority: P2
Component: binutils
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
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.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils