Disassembly with odd sized section
Subhash Verma
subhash.verma@wipro.com
Tue Nov 13 11:46:00 GMT 2001
More information about the Binutils mailing list
Tue Nov 13 11:46:00 GMT 2001
- Previous message (by thread): PATCH: Fix indirect symbol from default (Re: ld goes into infinite loop)
- Next message (by thread): Disassembly with odd sized section
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi all,
I found some problem with disassembler for Thumb(ARM) processor. Here
I am giving the input file and its disassembed output.
contents of input file (trail_zero.s)is:
----------------------------------------------------------
.text
lsl r6, r0, #4 ;some instruction
lsl r5, r0, #6 ;some instruction
.byte 0x08
.data
.byte 0x00
.byte 0x00
.byte 0x00
-------------------------------------------------------------
output (trail_zero.out) is assembled with ./arm-elf-as.exe -mthumb -a trail_zero.s -o trail_zero.out
output of disassembler is:
(./arm-elf-objdump.exe -D -disassembler-options=force-thumb trail_zero.out)
--------------------------------------------------------------
trail_zero.out: file format elf32-littlearm
Disassembly of section .text:
00000000 <.text>:
0: 0106 lsl r6, r0, #4
2: 0185 lsl r5, r0, #6
4: Address 0x4 is out of bounds.
Disassembly of section .data:
00000000 <.data>:
0: 0000 lsl r0, r0, #0
...
--------------------------------------------------------------
There is a problem in disassembler in handling the trailing byte for an odd sized section.
If it is non-zero ( as in text section )it gives "Address 0x4 is out of bounds" message.
and if it zero (like in data section) it simply replaces it with "...", instead of displaying it as '0x00'.
Another example:
input file:
------------------------------------------------------------------
.text
lsl r6, r0, #4 ;some instruction
lsl r7, r0, #5 ;some instruction
lsl r0, r0, #0
.data
.byte 0x00
.byte 0x00
.byte 0x00
--------------------------------------------------------------------
trail_zero.out: file format elf32-littlearm
Disassembly of section .text:
00000000 <.text>:
0: 0601 lsl r6, r0, #4
2: 4701 lsl r7, r0, #5
...
Disassembly of section .data:
00000000 <.data>:
0: 0000 lsl r0, r0, #0
...
----------------------------------------------------------------------
Here instead of disassembling the last instruction in text section it is replaced with "...",
because its opcode is "0x0000".
I think it is a bug in disassembler (objdump.c) for thumb(arm).
Could anybody please verify this. If it is a bug,please suggest any probable solution.
Thanks in advance.
Regards,
Subhash Verma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20011113/117966d5/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: InterScan_Disclaimer.txt
URL: <https://sourceware.org/pipermail/binutils/attachments/20011113/117966d5/attachment.txt>
- Previous message (by thread): PATCH: Fix indirect symbol from default (Re: ld goes into infinite loop)
- Next message (by thread): Disassembly with odd sized section
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list