public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: Jonathan Larmour <jlarmour@redhat.com>
Cc: "Trenton D. Adams" <tadams@extremeeng.com>,
	'eCos Discussion' <ecos-discuss@sourceware.cygnus.com>
Subject: Re: [ECOS] objdump for binary file
Date: Tue, 21 Aug 2001 13:22:00 -0000	[thread overview]
Message-ID: <20010821152426.A1261@visi.com> (raw)
In-Reply-To: <3B82BE3D.B73122BC@redhat.com>

On Tue, Aug 21, 2001 at 09:02:05PM +0100, Jonathan Larmour wrote:
> Grant Edwards wrote:
> > 
> > On Tue, Aug 21, 2001 at 01:23:22PM -0600, Trenton D. Adams wrote:
> > 
> > > I compiled an eCos program and then copied it to a binary file.  Is
> > > there a way of dumping the assembly now?
> > 
> > No.
> 
> Yes :-). It's not pretty and you've lost all the symbol info, but you can
> disassemble everything (including data!). e.g.
> 
> echo > foo.c
> arm-elf-gcc -c -o foo.o foo.c
> arm-elf-objcopy --remove-section=.text foo.o
> arm-elf-objcopy --add-section=.text=thebinfile foo.o
> arm-elf-objcopy --set-section-flags=.text=alloc,load,code,contents,readonly foo.o
> arm-elf-objdump -d foo.o

The bit at the top where you compile an empty C file to
generate all the right sections is clever -- I hadn't thought
of that.

One would hope he kept a copy of the ELF file -- or can
re-generate it.  Making sense of a binary file by disassembling
it requires considerable skill and can use up lots of hours for
a non-trivial program.

-- 
Grant Edwards
grante@visi.com

  parent reply	other threads:[~2001-08-21 13:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-21 12:23 Trenton D. Adams
2001-08-21 12:33 ` Grant Edwards
2001-08-21 13:02   ` Jonathan Larmour
2001-08-21 13:07     ` Trenton D. Adams
2001-08-21 13:08       ` Jonathan Larmour
2001-08-21 13:20         ` Trenton D. Adams
2001-08-21 13:22     ` Grant Edwards [this message]
2001-08-21 13:27       ` Trenton D. Adams
2001-08-21 13:32         ` Grant Edwards
2001-08-21 14:02           ` Trenton D. Adams
2001-08-21 13:05   ` Trenton D. Adams
2001-08-21 13:28     ` Grant Edwards
2001-08-27  8:02 Andre Asselin

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=20010821152426.A1261@visi.com \
    --to=grante@visi.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=jlarmour@redhat.com \
    --cc=tadams@extremeeng.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).