📄 bfd.h
字号:
should return zero on success or an `errno' code on failure. TEMPL must be a BFD for an ELF target with the word size and byte order found in the remote memory. */extern bfd *bfd_elf_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));/* Return the arch_size field of an elf bfd, or -1 if not elf. */extern int bfd_get_arch_size (bfd *);/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */extern int bfd_get_sign_extend_vma (bfd *);extern struct bfd_section *_bfd_elf_tls_setup (bfd *, struct bfd_link_info *);extern void _bfd_fix_excluded_sec_syms (bfd *, struct bfd_link_info *);extern unsigned bfd_m68k_mach_to_features (int);extern int bfd_m68k_features_to_mach (unsigned);extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);/* SunOS shared library support routines for the linker. */extern struct bfd_link_needed_list *bfd_sunos_get_needed_list (bfd *, struct bfd_link_info *);extern bfd_boolean bfd_sunos_record_link_assignment (bfd *, struct bfd_link_info *, const char *);extern bfd_boolean bfd_sunos_size_dynamic_sections (bfd *, struct bfd_link_info *, struct bfd_section **, struct bfd_section **, struct bfd_section **);/* Linux shared library support routines for the linker. */extern bfd_boolean bfd_i386linux_size_dynamic_sections (bfd *, struct bfd_link_info *);extern bfd_boolean bfd_m68klinux_size_dynamic_sections (bfd *, struct bfd_link_info *);extern bfd_boolean bfd_sparclinux_size_dynamic_sections (bfd *, struct bfd_link_info *);/* mmap hacks */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);void bfd_elf32_arm_set_target_relocs (struct bfd_link_info *, int, char *, 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 *);/* ELF ARM mapping symbol support */#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)extern bfd_boolean bfd_is_arm_special_symbol_name (const char * name, int type);/* 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_fopen (const char *filename, const char *target, const char *mode, int fd);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) \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -