Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: Nick Clifton <nickc@redhat.com>
Cc: Andrew Cagney <ac131313@redhat.com>,
	gdb-patches@sources.redhat.com, binutils@sources.redhat.com,
	Richard.Earnshaw@arm.com
Subject: Re: RFA: Skip ARM ELF Mapping symbols when showing disassembly
Date: Tue, 25 Nov 2003 12:34:00 -0000	[thread overview]
Message-ID: <200311251234.hAPCYYS11633@pc960.cambridge.arm.com> (raw)
In-Reply-To: Your message of "Tue, 25 Nov 2003 12:22:11 GMT." <m3vfp8zlho.fsf@redhat.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.


      reply	other threads:[~2003-11-25 12:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-13 14:29 Nick Clifton
2003-11-13 14:45 ` Richard Earnshaw
2003-11-13 15:20   ` Daniel Jacobowitz
2004-01-14 23:42   ` Daniel Jacobowitz
2004-01-20 13:23     ` Nick Clifton
2003-11-18 16:15 ` Andrew Cagney
2003-11-18 16:45   ` Richard Earnshaw
2003-11-18 17:20     ` Andrew Cagney
2003-11-18 17:29       ` Richard Earnshaw
2003-11-18 17:41         ` Andrew Cagney
2003-11-18 19:55   ` Nick Clifton
2003-11-25 12:25   ` Nick Clifton
2003-11-25 12:34     ` Richard Earnshaw [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200311251234.hAPCYYS11633@pc960.cambridge.arm.com \
    --to=rearnsha@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=ac131313@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox