This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Skip ARM ELF Mapping symbols when showing disassembly


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]