📄 bfd.h
字号:
struct _bfd_window_internal;typedef struct _bfd_window_internal bfd_window_internal;typedef struct _bfd_window{ /* What the user asked for. */ void *data; bfd_size_type size; /* The actual window used by BFD. Small user-requested read-only regions sharing a page may share a single window into the object file. Read-write versions shouldn't until I've fixed things to keep track of which portions have been claimed by the application; don't want to give the same region back when the application wants two writable copies! */ struct _bfd_window_internal *i;}bfd_window;extern void bfd_init_window (bfd_window *);extern void bfd_free_window (bfd_window *);extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);/* XCOFF support routines for the linker. */extern bfd_boolean bfd_xcoff_link_record_set (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);extern bfd_boolean bfd_xcoff_import_symbol (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, const char *, const char *, const char *, unsigned int);extern bfd_boolean bfd_xcoff_export_symbol (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);extern bfd_boolean bfd_xcoff_link_count_reloc (bfd *, struct bfd_link_info *, const char *);extern bfd_boolean bfd_xcoff_record_link_assignment (bfd *, struct bfd_link_info *, const char *);extern bfd_boolean bfd_xcoff_size_dynamic_sections (bfd *, struct bfd_link_info *, const char *, const char *, unsigned long, unsigned long, unsigned long, bfd_boolean, int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean);extern bfd_boolean bfd_xcoff_link_generate_rtinit (bfd *, const char *, const char *, bfd_boolean);/* XCOFF support routines for ar. */extern bfd_boolean bfd_xcoff_ar_archive_set_magic (bfd *, char *);/* Externally visible COFF routines. */#if defined(__STDC__) || defined(ALMOST_STDC)struct internal_syment;union internal_auxent;#endifextern bfd_boolean bfd_coff_get_syment (bfd *, struct bfd_symbol *, struct internal_syment *);extern bfd_boolean bfd_coff_get_auxent (bfd *, struct bfd_symbol *, int, union internal_auxent *);extern bfd_boolean bfd_coff_set_symbol_class (bfd *, struct bfd_symbol *, unsigned int);extern bfd_boolean bfd_m68k_coff_create_embedded_relocs (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);/* ARM Interworking support. Called from linker. */extern bfd_boolean bfd_arm_allocate_interworking_sections (struct bfd_link_info *);extern bfd_boolean bfd_arm_process_before_allocation (bfd *, struct bfd_link_info *, int);extern bfd_boolean bfd_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *);/* PE ARM Interworking support. Called from linker. */extern bfd_boolean bfd_arm_pe_allocate_interworking_sections (struct bfd_link_info *);extern bfd_boolean bfd_arm_pe_process_before_allocation (bfd *, struct bfd_link_info *, int);extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking (bfd *, struct bfd_link_info *);/* ELF ARM Interworking support. Called from linker. */extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info *);extern bfd_boolean bfd_elf32_arm_process_before_allocation (bfd *, struct bfd_link_info *, int, int);extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *);extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd (bfd *, struct bfd_link_info *);/* ARM Note section processing. */extern bfd_boolean bfd_arm_merge_machines (bfd *, bfd *);extern bfd_boolean bfd_arm_update_notes (bfd *, const char *);extern unsigned int bfd_arm_get_mach_from_notes (bfd *, const char *);/* TI COFF load page support. */extern void bfd_ticoff_set_section_load_page (struct bfd_section *, int);extern int bfd_ticoff_get_section_load_page (struct bfd_section *);/* H8/300 functions. */extern bfd_vma bfd_h8300_pad_address (bfd *, bfd_vma);/* IA64 Itanium code generation. Called from linker. */extern void bfd_elf32_ia64_after_parse (int);extern void bfd_elf64_ia64_after_parse (int);/* This structure is used for a comdat section, as in PE. A comdat section is associated with a particular symbol. When the linker sees a comdat section, it keeps only one of the sections with a given name and associated with a given symbol. */struct coff_comdat_info{ /* The name of the symbol associated with a comdat section. */ const char *name; /* The local symbol table index of the symbol associated with a comdat section. This is only meaningful to the object file format specific code; it is not an index into the list returned by bfd_canonicalize_symtab. */ long symbol;};extern struct coff_comdat_info *bfd_coff_get_comdat_section (bfd *, struct bfd_section *);/* Extracted from init.c. */void bfd_init (void);/* Extracted from opncls.c. */bfd *bfd_openr (const char *filename, const char *target);bfd *bfd_fdopenr (const char *filename, const char *target, int fd);bfd *bfd_openstreamr (const char *, const char *, void *);bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open) (struct bfd *nbfd, void *open_closure), void *open_closure, file_ptr (*pread) (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes, file_ptr offset), int (*close) (struct bfd *nbfd, void *stream));bfd *bfd_openw (const char *filename, const char *target);bfd_boolean bfd_close (bfd *abfd);bfd_boolean bfd_close_all_done (bfd *);bfd *bfd_create (const char *filename, bfd *templ);bfd_boolean bfd_make_writable (bfd *abfd);bfd_boolean bfd_make_readable (bfd *abfd);unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len);char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename);bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename);/* Extracted from libbfd.c. *//* Byte swapping macros for user section data. */#define bfd_put_8(abfd, val, ptr) \ ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))#define bfd_put_signed_8 \ bfd_put_8#define bfd_get_8(abfd, ptr) \ (*(unsigned char *) (ptr) & 0xff)#define bfd_get_signed_8(abfd, ptr) \ (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)#define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))#define bfd_put_signed_16 \ bfd_put_16#define bfd_get_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx16, (ptr))#define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr))#define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))#define bfd_put_signed_32 \ bfd_put_32#define bfd_get_32(abfd, ptr) \ BFD_SEND (abfd, bfd_getx32, (ptr))#define bfd_get_signed_32(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_32, (ptr))#define bfd_put_64(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))#define bfd_put_signed_64 \ bfd_put_64#define bfd_get_64(abfd, ptr) \ BFD_SEND (abfd, bfd_getx64, (ptr))#define bfd_get_signed_64(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_64, (ptr))#define bfd_get(bits, abfd, ptr) \ ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ : (abort (), (bfd_vma) - 1))#define bfd_put(bits, abfd, val, ptr) \ ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ : (abort (), (void) 0))/* Byte swapping macros for file header data. */#define bfd_h_put_8(abfd, val, ptr) \ bfd_put_8 (abfd, val, ptr)#define bfd_h_put_signed_8(abfd, val, ptr) \ bfd_put_8 (abfd, val, ptr)#define bfd_h_get_8(abfd, ptr) \ bfd_get_8 (abfd, ptr)#define bfd_h_get_signed_8(abfd, ptr) \ bfd_get_signed_8 (abfd, ptr)#define bfd_h_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_h_putx16, (val, ptr))#define bfd_h_put_signed_16 \ bfd_h_put_16#define bfd_h_get_16(abfd, ptr) \ BFD_SEND (abfd, bfd_h_getx16, (ptr))#define bfd_h_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))#define bfd_h_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_h_putx32, (val, ptr))#define bfd_h_put_signed_32 \ bfd_h_put_32#define bfd_h_get_32(abfd, ptr) \ BFD_SEND (abfd, bfd_h_getx32, (ptr))#define bfd_h_get_signed_32(abfd, ptr) \ BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))#define bfd_h_put_64(abfd, val, ptr) \ BFD_SEND (abfd, bfd_h_putx64, (val, ptr))#define bfd_h_put_signed_64 \ bfd_h_put_64#define bfd_h_get_64(abfd, ptr) \ BFD_SEND (abfd, bfd_h_getx64, (ptr))#define bfd_h_get_signed_64(abfd, ptr) \ BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))/* Aliases for the above, which should eventually go away. */#define H_PUT_64 bfd_h_put_64#define H_PUT_32 bfd_h_put_32#define H_PUT_16 bfd_h_put_16#define H_PUT_8 bfd_h_put_8#define H_PUT_S64 bfd_h_put_signed_64#define H_PUT_S32 bfd_h_put_signed_32#define H_PUT_S16 bfd_h_put_signed_16#define H_PUT_S8 bfd_h_put_signed_8#define H_GET_64 bfd_h_get_64#define H_GET_32 bfd_h_get_32#define H_GET_16 bfd_h_get_16#define H_GET_8 bfd_h_get_8#define H_GET_S64 bfd_h_get_signed_64#define H_GET_S32 bfd_h_get_signed_32#define H_GET_S16 bfd_h_get_signed_16#define H_GET_S8 bfd_h_get_signed_8/* Extracted from bfdio.c. */long bfd_get_mtime (bfd *abfd);long bfd_get_size (bfd *abfd);/* Extracted from bfdwin.c. *//* Extracted from section.c. */typedef struct bfd_section{ /* 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; /* A unique sequence number. */ int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; /* The field flags contains attributes of the section. Some 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 loading. This is 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 is clear for a .bss section. */#define SEC_LOAD 0x002 /* The section contains data still to be relocated, so there is some relocation information too. */#define SEC_RELOC 0x004 /* ELF reserves 4 processor specific bits and 8 operating system specific bits in sh_flags; at present we can get away with just one in communicating between the assembler and BFD, but this isn't a good long-term solution. */#define SEC_ARCH_BIT_0 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -