Happy shrimp
Http://blog.csdn.net/lights_joy/
Lights@hb165.com
This article applies
Bfinutils-2.19
Vs2008
Reprinted, but keep the author information
In 《BFD support for multiple targetsAll target support is achieved by redefining the function pointer of the struct bfd_target. Elf32 is a common file format, but because of the differences between different processors and target systems, these file formats are slightly different. To maximize code reuse, BFD allows all file processors in elf32 format (* _ VEC variable) definitions to share a file: elf32-target.h. This file has the following definitions:
Const bfd_target target_little_sym =
{
/* Name: Identify kind of target */
Target_little_name,
/* Flavor: general indication about file */
Bfd_target_elf_flavour,
/* Byteorder: data is little endian */
Bfd_endian_little,
/* Header_byteorder: header is also little endian */
Bfd_endian_little,
........................................
/* Backend_data :*/
& Elf32_bed
};
This header file is only used inside the BFD library and used in the C file.
# Include "elf32-target.h"
Previously, BFD first defined some macros, such:
# Define target_little_sym bfd_elf32_bfin_vec
# Define target_little_name "elf32-bfin"
# Define elf_arch bfd_arch_bfin
# Define elf_machine_code em_blackfin
# Define elf_maxpagesize 0x1000
# Define elf_symbol_leading_char '_'
...........................
In this way, after macro replacement, different targets can be used with different processing methods.
Search for "elf32-target.h" in the BFD code, it is easy to find all the elf32 format target, huh, huh!
References
BFD support for multiple targets( )