This is the mail archive of the binutils@sources.redhat.com 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: About bfd (Binary File Descriptor)


libra <mr924352@cs.nthu.edu.tw> writes:

> For example, when i compile a c file to an executable file by using gcc,
> i use the arm-elf-objdump(cross compile for target "arm") to dump the 
> executable file.Obviously,this will show the error message like "arm-elf-
> objdump: a.exe: File format not recognized".
> 
> I try to find where is the program to examine the file format(ex:pei-i386 or 
> elf32-littlearm). But, i get nothing.
> I think there must be some place to set the file format information, and to 
> check the file format when you wnat to execute this executable file or to dump 
> it.

For an ELF file that information is stored in the ELF header which is
the first 52 bytes of the file (for a 32 bit target).

For most ELF files, you can use the 'file' program, or 'readelf -h' to
see the specific type of ELF file.

Note that pei-i386 is not an ELF format.

In many cases you can build the binutils using the configure option
'--enable-targets=all'.  You can then use the resulting objdump
program on any file format which BFD recognizes.

Ian


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