This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: File not recognized in objdump!!


On Tue, 2007-03-27 at 12:54 +0530, Aashish Gupta wrote:
> (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;

There are a lot of problems with what you are doing here.

First of all, you are debugging the assembler, not objdump here.  See
the "starting program" line, and the fact that as_perror is an assembler
routine.  Also, you are running it incorrectly, as you passed the
objdump binary to it.  The assembler only accepts assembly source files
as input.  You need to be debugging the right program with the right
input.

You set the bfd_check_format_matches breakpoint after starting the
program, and then typed next, which is not going to work.  This will
leave you where you are already stopped, which is in the as_perror
function.  This routine just prints out the error message, which is far
too late to be useful.

You need to set the breakpoint first, and then run the program.  If you
debug the right program, and the right function, you will see that it
ends up calling the elf64_ia64_object_p function which Nick pointed you
at.

binutils is a large and complicated package.  You will need to spend a
lot more time learning how it works, and how to use basic tools like
gdb, if you wish to be successful modifying it.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com



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