About bfd (Binary File Descriptor)

libra mr924352@cs.nthu.edu.tw
Fri Apr 16 02:32:00 GMT 2004


I am still confused.

After assembling,it will prodece an object file(assume that it not yet linked 
by linker to become an executable file).In this stage, there must be some 
information to be wrote to the object file inclde the target file format like
elf32-littlearm (ex:arm),header, section and so on.

My question is :
There must be some place where the program (assembler) to set the file format 
information in the object file(*.o),and where the program (simulator in gdb) 
to check the file format to determin this file format is recognized or not.  

                                               
                                                     
                                   Sorry for my poor english,and thanks a lot!!

----- Original Message ----- 
> > 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
> 



More information about the Binutils mailing list