⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bfd.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 4 页
字号:
                BFD_SEND(abfd, bfd_putx16, (val,ptr))#define bfd_get_16(abfd, ptr) \                BFD_SEND(abfd, bfd_getx16, (ptr))#define bfd_put_32(abfd, val, ptr) \                BFD_SEND(abfd, bfd_putx32, (val,ptr))#define bfd_get_32(abfd, ptr) \                BFD_SEND(abfd, bfd_getx32, (ptr))#define bfd_put_64(abfd, val, ptr) \                BFD_SEND(abfd, bfd_putx64, (val, ptr))#define bfd_get_64(abfd, ptr) \                BFD_SEND(abfd, bfd_getx64, (ptr))#define bfd_h_put_8(abfd, val, ptr) \                (*((char *)ptr) = (char)val)#define bfd_h_get_8(abfd, ptr) \                (*((char *)ptr))#define bfd_h_put_16(abfd, val, ptr) \                BFD_SEND(abfd, bfd_h_putx16,(val,ptr))#define bfd_h_get_16(abfd, ptr) \                BFD_SEND(abfd, bfd_h_getx16,(ptr))#define bfd_h_put_32(abfd, val, ptr) \                BFD_SEND(abfd, bfd_h_putx32,(val,ptr))#define bfd_h_get_32(abfd, ptr) \                BFD_SEND(abfd, bfd_h_getx32,(ptr))#define bfd_h_put_64(abfd, val, ptr) \                BFD_SEND(abfd, bfd_h_putx64,(val, ptr))#define bfd_h_get_64(abfd, ptr) \                BFD_SEND(abfd, bfd_h_getx64,(ptr))typedef struct sec {         /* The name of the section, the name isn't a copy, the pointer is        the same as that passed to bfd_make_section. */    CONST char *name;         /* Which section is it 0.nth      */   int index;                               /* The next section in the list belonging to the BFD, or NULL. */    struct sec *next;         /* The field flags contains attributes of the section. Some of           flags are read in from the object file, and some are           synthesized from other information.  */             flagword flags;#define SEC_NO_FLAGS   0x000         /* Tells the OS to allocate space for this section when loaded.           This would clear for a section containing debug information           only. */          #define SEC_ALLOC      0x001         /* Tells the OS to load the section from the file when loading.           This would be clear for a .bss section */#define SEC_LOAD       0x002         /* The section contains data still to be relocated, so there will           be some relocation information too. */#define SEC_RELOC      0x004         /* Obsolete ? */#define SEC_BALIGN     0x008         /* A signal to the OS that the section contains read only          data. */#define SEC_READONLY   0x010         /* The section contains code only. */#define SEC_CODE       0x020         /* The section contains data only. */#define SEC_DATA        0x040         /* The section will reside in ROM. */#define SEC_ROM        0x080         /* The section contains constructor information. This section           type is used by the linker to create lists of constructors and           destructors used by <<g++>>. When a back end sees a symbol           which should be used in a constructor list, it creates a new           section for the type of name (eg <<__CTOR_LIST__>>), attaches           the symbol to it and builds a relocation. To build the lists           of constructors, all the linker has to to is catenate all the           sections called <<__CTOR_LIST__>> and relocte the data           contained within - exactly the operations it would peform on           standard data. */#define SEC_CONSTRUCTOR 0x100         /* The section is a constuctor, and should be placed at the          end of the . */#define SEC_CONSTRUCTOR_TEXT 0x1100#define SEC_CONSTRUCTOR_DATA 0x2100#define SEC_CONSTRUCTOR_BSS  0x3100         /* The section has contents - a bss section could be           <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>, a debug section could be           <<SEC_HAS_CONTENTS>> */#define SEC_HAS_CONTENTS 0x200         /* An instruction to the linker not to output sections          containing this flag even if they have information which          would normally be written. */#define SEC_NEVER_LOAD 0x400          bfd_vma vma;   boolean user_set_vma;         /* The size of the section in bytes, as it will be output.           contains a value even if the section has no contents (eg, the           size of <<.bss>>). This will be filled in after relocation */   bfd_size_type _cooked_size;             /* The size on disk of the section in bytes originally.  Normally this	    value is the same as the size, but if some relaxing has	    been done, then this value will be bigger.  */   bfd_size_type _raw_size;             /* If this section is going to be output, then this value is the           offset into the output section of the first byte in the input           section. Eg, if this was going to start at the 100th byte in           the output section, this value would be 100. */   bfd_vma output_offset;         /* The output section through which to map on output. */   struct sec *output_section;         /* The alignment requirement of the section, as an exponent - eg           3 aligns to 2^3 (or 8) */   unsigned int alignment_power;         /* If an input section, a pointer to a vector of relocation           records for the data in this section. */   struct reloc_cache_entry *relocation;         /* If an output section, a pointer to a vector of pointers to           relocation records for the data in this section. */   struct reloc_cache_entry **orelocation;         /* The number of relocation records in one of the above  */   unsigned reloc_count;         /* Information below is back end specific - and not always used           or updated            File position of section data    */   file_ptr filepos;                       /* File position of relocation info */   file_ptr rel_filepos;         /* File position of line data       */   file_ptr line_filepos;         /* Pointer to data for applications */   PTR userdata;   struct lang_output_section *otheruserdata;         /* Attached line number information */   alent *lineno;                 /* Number of line number records   */   unsigned int lineno_count;         /* When a section is being output, this value changes as more           linenumbers are written out */   file_ptr moving_line_filepos;         /* what the section number is in the target world  */   int target_index;   PTR used_by_bfd;         /* If this is a constructor section then here is a list of the           relocations created to relocate items within it. */   struct relent_chain *constructor_chain;         /* The BFD which owns the section. */   bfd *owner;   boolean reloc_done;	  /* A symbol which points at this section only */   struct symbol_cache_entry *symbol;     struct symbol_cache_entry **symbol_ptr_ptr;   struct bfd_seclet_struct *seclets_head;   struct bfd_seclet_struct *seclets_tail;} asection ;#define BFD_ABS_SECTION_NAME "*ABS*"#define BFD_UND_SECTION_NAME "*UND*"#define BFD_COM_SECTION_NAME "*COM*"     /* the absolute section */ extern   asection bfd_abs_section;     /* Pointer to the undefined section */ extern   asection bfd_und_section;     /* Pointer to the common section */ extern asection bfd_com_section; extern struct symbol_cache_entry *bfd_abs_symbol; extern struct symbol_cache_entry *bfd_com_symbol; extern struct symbol_cache_entry *bfd_und_symbol;#define bfd_get_section_size_before_reloc(section) \     (section->reloc_done ? (abort(),1): (section)->_raw_size)#define bfd_get_section_size_after_reloc(section) \     ((section->reloc_done) ? (section)->_cooked_size: (abort(),1))asection *EXFUN(bfd_get_section_by_name, (bfd *abfd, CONST char *name));asection *EXFUN(bfd_make_section_old_way, (bfd *, CONST char *name));asection * EXFUN(bfd_make_section, (bfd *, CONST char *name));boolean EXFUN(bfd_set_section_flags, (bfd *, asection *, flagword));void EXFUN(bfd_map_over_sections, (bfd *abfd,    void (*func)(bfd *abfd,    asection *sect,    PTR obj),    PTR obj));boolean EXFUN(bfd_set_section_size, (bfd *, asection *, bfd_size_type val));boolean EXFUN(bfd_set_section_contents    , (bfd *abfd,            asection *section,    PTR data,    file_ptr offset,    bfd_size_type count));boolean EXFUN(bfd_get_section_contents     , (bfd *abfd, asection *section, PTR location,    file_ptr offset, bfd_size_type count));enum bfd_architecture {  bfd_arch_unknown,    /* File arch not known */  bfd_arch_obscure,    /* Arch known, not one of these */  bfd_arch_m68k,       /* Motorola 68xxx */  bfd_arch_vax,        /* DEC Vax */     bfd_arch_i960,       /* Intel 960 */     /* The order of the following is important.       lower number indicates a machine type that        only accepts a subset of the instructions       available to machines with higher numbers.       The exception is the "ca", which is       incompatible with all other machines except        "core". */#define bfd_mach_i960_core      1#define bfd_mach_i960_ka_sa     2#define bfd_mach_i960_kb_sb     3#define bfd_mach_i960_mc        4#define bfd_mach_i960_xa        5#define bfd_mach_i960_ca        6  bfd_arch_a29k,       /* AMD 29000 */  bfd_arch_sparc,      /* SPARC */  bfd_arch_mips,       /* MIPS Rxxxx */  bfd_arch_i386,       /* Intel 386 */  bfd_arch_we32k,      /* AT&T WE32xxx */  bfd_arch_tahoe,      /* CCI/Harris Tahoe */  bfd_arch_i860,       /* Intel 860 */  bfd_arch_romp,       /* IBM ROMP PC/RT */  bfd_arch_alliant,    /* Alliant */  bfd_arch_convex,     /* Convex */  bfd_arch_m88k,       /* Motorola 88xxx */  bfd_arch_pyramid,    /* Pyramid Technology */  bfd_arch_h8300,      /* Hitachi H8/300 */  bfd_arch_rs6000,     /* IBM RS/6000 */  bfd_arch_hppa,       /* HP PA RISC */  bfd_arch_z8k,        /* Zilog Z8000 */#define bfd_mach_z8001		1#define bfd_mach_z8002		2  bfd_arch_last  };typedef struct bfd_arch_info {  int bits_per_word;  int bits_per_address;  int bits_per_byte;  enum bfd_architecture arch;  long mach;  char *arch_name;  CONST  char *printable_name;  unsigned int section_align_power;  /* true if this is the default machine for the architecture */  boolean the_default;	  CONST struct bfd_arch_info * EXFUN((*compatible),	(CONST struct bfd_arch_info *a,	 CONST struct bfd_arch_info *b));  boolean EXFUN((*scan),(CONST struct bfd_arch_info *,CONST char *));  unsigned int EXFUN((*disassemble),(bfd_vma addr, CONST char *data,				     PTR stream));  struct bfd_arch_info *next;} bfd_arch_info_type;CONST char *EXFUN(bfd_printable_name, (bfd *abfd));bfd_arch_info_type *EXFUN(bfd_scan_arch, (CONST char *));CONST bfd_arch_info_type *EXFUN(bfd_arch_get_compatible, (    CONST bfd *abfd,    CONST bfd *bbfd));void EXFUN(bfd_set_arch_info, (bfd *, bfd_arch_info_type *));enum bfd_architecture EXFUN(bfd_get_arch, (bfd *abfd));unsigned long EXFUN(bfd_get_mach, (bfd *abfd));unsigned int EXFUN(bfd_arch_bits_per_byte, (bfd *abfd));unsigned int EXFUN(bfd_arch_bits_per_address, (bfd *abfd));bfd_arch_info_type * EXFUN(bfd_get_arch_info, (bfd *));bfd_arch_info_type *EXFUN(bfd_lookup_arch    , (enum bfd_architecture    arch,    long machine));CONST char * EXFUN(bfd_printable_arch_mach    , (enum bfd_architecture arch, unsigned long machine));typedef enum bfd_reloc_status {        /* No errors detected */  bfd_reloc_ok,        /* The relocation was performed, but there was an overflow. */  bfd_reloc_overflow,        /* The address to relocate was not within the section supplied*/  bfd_reloc_outofrange,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -