BFD support for elf32 format

Source: Internet
Author: User

 

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( )

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.