This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: About bfd (Binary File Descriptor)
- From: libra <mr924352 at cs dot nthu dot edu dot tw>
- To: binutils at sources dot redhat dot com
- Date: Fri, 16 Apr 2004 10:09:23 +0800
- Subject: Re: About bfd (Binary File Descriptor)
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
>