This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


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

RE: objdump for binary file


All I'm looking for is accesses to specific areas of memory.  If I can
find the references to those areas of memory, it shouldn't be that
difficult, should it?

I've done it with TRIVIAL programs before, but never something so
complex.  It's 257K of assembly.  Ouch.

-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[mailto:ecos-discuss-owner@sources.redhat.com] On Behalf Of Grant
Edwards
Sent: Tuesday, August 21, 2001 2:25 PM
To: Jonathan Larmour
Cc: Trenton D. Adams; 'eCos Discussion'
Subject: Re: [ECOS] objdump for binary file


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


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