This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: objdump command to disassemble raw MIPS binary
- From: Nick Clifton <nickc at redhat dot com>
- To: "A.W.C." <bluestream at ymail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 7 Aug 2018 17:46:39 +0100
- Subject: Re: objdump command to disassemble raw MIPS binary
- References: <236020270.2578979.1533554605574.ref@mail.yahoo.com> <236020270.2578979.1533554605574@mail.yahoo.com>
Hi Alex,
> It turns out the problem is that files I have are not ELF binaries.
> So, question is how to convert the binary data file into a valid ELF executable?
It sounds like you need to use the assembler's .incbin directive.
Something like this:
% cat foo.s
.text
.incbin "binary-file"
If you assemble this you should end up with an ELF object file with
the contents of "binary-file" in the .text section. If you need the
file to be an executable you can just run it through the linker afterwards.
Cheers
Nick