This is the mail archive of the
mailing list for the binutils project.
Re: assembling output of objdump dissassembly
- From: Nick Clifton <nickc at redhat dot com>
- To: SigmFSK at aol dot com
- Cc: binutils at sourceware dot org
- Date: Thu, 12 Oct 2006 10:13:31 +0100
- Subject: Re: assembling output of objdump dissassembly
- References: <firstname.lastname@example.org>
It appears that the objdump output is quite similar to, but deliberately
different from, the assembly created from compiling a c program with "gcc -S".
Is there a mechanism to convert the objdump disassembly output to an
Apart from doing this by hand, no.
Or is that a deliberate objdump decision to have the output
different, as my desire is inherently unworkable,
It was a deliberate decision but the motive was to make disassembler's
output be useful to people who want to examine the contents of a binary
file, not to allow re-assembly. To this end, more information is
presented to the user than is needed to just re-assemble the
as modifying the disassembly
would change all the branch offsets and cause everything to break?
No, the real problem is coping with relocations. The disassembled
output of a file is not just the textual disassembly, but also the
relocations that are associated with that disassembly. You would need
some way to re-install those relocations back into the assembler source,
possibly regenerating local labels as you go. A difficult task.