This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: File not recognized in objdump!!
Jim,
I already stepped through the fucntion "bfd_check_format_matches" and
figured out that its not recognizing the target format ... The error
looks something like this..
(gdb) run objdump
Starting program: /root/Desktop/binutils1/gas/as-new objdump
Breakpoint 6, as_perror (gripe=0x80d7638 "Selected target format '%s' unknown",
filename=0x80db2be "elf64-ia64-little") at messages.c:124
((Our target is elf64-ia64-big though ..?? and have made modification
accordingly..))
124 {
(gdb) break bfd_check_format_matches
Breakpoint 9 at 0x8088099: file format.c, line 118.
(gdb) n
126 int saved_errno = errno;
(gdb) n
128 as_show_where ();
(gdb) n
Assembler messages:
129 fprintf (stderr, gripe, filename);
(gdb) n
Selected target format 'elf64-ia64-little' unknown130 errno = saved_errno;
(gdb) n
131 errtxt = bfd_errmsg (bfd_get_error ());
(gdb) n
132 fprintf (stderr, ": %s\n", errtxt);
(gdb) n
: Invalid bfd target
133 errno = 0;
(gdb) n
135 }
(gdb) n
134 bfd_set_error (bfd_error_no_error);
(gdb)
135 }
(gdb) n
as_perror (gripe=0x80d4a34 "a.out", filename=0x0) at messages.c:134
134 bfd_set_error (bfd_error_no_error);
Thanks..
On 3/27/07, Jim Wilson <wilson@specifix.com> wrote:
> On Mon, 2007-03-26 at 10:44 +0530, Aashish Gupta wrote:
> > I am trying to modify objdump to dump object file information for a
> > ELF64 file but on a different
> > kernel but its giving an error saying file format not recognized.
>
> Trying the command
> grep "File format not recognized"
> we find it is defined in bfd.c. Looking at this file, we see that this
> is in an error, and an enum defined nearby shows that the array index is
> bfd_error_file_not_recognized. So now grepping for that enum, we find
> that there are two bfd_set_error calls in the file format.c that use it.
> Both calls are in the function bfd_check_format_matches. Run objdump
> under gdb, put a breakpoint here, and step through the code to see what
> it is doing.
> --
> Jim Wilson, GNU Tools Support, http://www.specifix.com
>
>
>
--
Regards,
Aashish Gupta.
---------------------------------------------------
Live life as you have no tomorrow, dream as you have eternity..!!
--
Regards,
Aashish Gupta.
---------------------------------------------------
Live life as you have no tomorrow, dream as you have eternity..!!