This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: Skip ARM ELF Mapping symbols when showing disassembly
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Andrew Cagney <ac131313 at redhat dot com>, gdb-patches at sources dot redhat dot com, binutils at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Tue, 25 Nov 2003 12:34:33 +0000
- Subject: Re: RFA: Skip ARM ELF Mapping symbols when showing disassembly
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> Hi Andrew,
>
> > Hmm, what information do those mapping symbols provide? Dig dig (from
> > tc-arm.c) ...
> [snip]
> > So GDB and objdump both need this information?
>
> Well yes and no...
>
> > How does objdump handle all this?
>
> Apart from a hack to objdump to skip the mapping symbols when
> displaying disassembly it does not use them.
>
It should use them. Then it can correctly disassemble data as data rather
than instructions.
> Objdump (and gdb) both have perfectly adequate mechanisms for
> distinguishing between code and data and between ARM and THUMB
> instructions, so they do not need the mapping symbols.
>
No they don't. Try to disassemble a function that contains a mix of ARM
and Thumb code and you will find that gdb/objdump just get it wrong.
For example:
.code 16
.thumb_func
.align 0
.global func
func:
bx pc
nop
.code 32
bx lr
which is disassembled as
a.out: file format elf32-littlearm
Disassembly of section .text:
00000000 <func>:
0: 4778 bx pc
2: 46c0 nop (mov r8, r8)
4: ff1e second half of BL instruction 0xff1e
6: e12f b 268 <func+0x268>
R.