version 1.4, 2016/12/14 21:49:13 |
version 1.5, 2018/04/14 17:53:01 |
|
|
|
|
/* Main header file for the bfd library -- portable access to object files. |
/* Main header file for the bfd library -- portable access to object files. |
|
|
Copyright (C) 1990-2015 Free Software Foundation, Inc. |
Copyright (C) 1990-2016 Free Software Foundation, Inc. |
|
|
Contributed by Cygnus Support. |
Contributed by Cygnus Support. |
|
|
Line 522 extern void warn_deprecated (const char |
|
Line 522 extern void warn_deprecated (const char |
|
#define bfd_get_file_flags(abfd) ((abfd)->flags) |
#define bfd_get_file_flags(abfd) ((abfd)->flags) |
#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) |
#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) |
#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) |
#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) |
#define bfd_my_archive(abfd) ((abfd)->my_archive) |
|
#define bfd_has_map(abfd) ((abfd)->has_armap) |
#define bfd_has_map(abfd) ((abfd)->has_armap) |
#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) |
#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) |
|
|
Line 914 extern bfd_boolean bfd_elf32_arm_get_bfd |
|
Line 913 extern bfd_boolean bfd_elf32_arm_get_bfd |
|
extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd |
extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd |
(bfd *, struct bfd_link_info *); |
(bfd *, struct bfd_link_info *); |
|
|
|
extern void bfd_elf32_arm_keep_private_stub_output_sections |
|
(struct bfd_link_info *); |
|
|
/* ELF ARM mapping symbol support. */ |
/* ELF ARM mapping symbol support. */ |
#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) |
#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) |
#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) |
#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) |
Line 945 extern void elf32_arm_next_input_section |
|
Line 947 extern void elf32_arm_next_input_section |
|
(struct bfd_link_info *, struct bfd_section *); |
(struct bfd_link_info *, struct bfd_section *); |
extern bfd_boolean elf32_arm_size_stubs |
extern bfd_boolean elf32_arm_size_stubs |
(bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, |
(bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, |
struct bfd_section * (*) (const char *, struct bfd_section *, unsigned int), |
struct bfd_section * (*) (const char *, struct bfd_section *, |
|
struct bfd_section *, unsigned int), |
void (*) (void)); |
void (*) (void)); |
extern bfd_boolean elf32_arm_build_stubs |
extern bfd_boolean elf32_arm_build_stubs |
(struct bfd_link_info *); |
(struct bfd_link_info *); |
Line 958 extern bfd_boolean elf32_arm_fix_exidx_c |
|
Line 961 extern bfd_boolean elf32_arm_fix_exidx_c |
|
extern bfd_boolean elf32_tic6x_fix_exidx_coverage |
extern bfd_boolean elf32_tic6x_fix_exidx_coverage |
(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); |
(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); |
|
|
/* PowerPC @tls opcode transform/validate. */ |
|
extern unsigned int _bfd_elf_ppc_at_tls_transform |
|
(unsigned int, unsigned int); |
|
/* PowerPC @tprel opcode transform/validate. */ |
|
extern unsigned int _bfd_elf_ppc_at_tprel_transform |
|
(unsigned int, unsigned int); |
|
|
|
extern void bfd_elf64_aarch64_init_maps |
extern void bfd_elf64_aarch64_init_maps |
(bfd *); |
(bfd *); |
|
|
Line 972 extern void bfd_elf32_aarch64_init_maps |
|
Line 968 extern void bfd_elf32_aarch64_init_maps |
|
(bfd *); |
(bfd *); |
|
|
extern void bfd_elf64_aarch64_set_options |
extern void bfd_elf64_aarch64_set_options |
(bfd *, struct bfd_link_info *, int, int, int, int, int); |
(bfd *, struct bfd_link_info *, int, int, int, int, int, int); |
|
|
extern void bfd_elf32_aarch64_set_options |
extern void bfd_elf32_aarch64_set_options |
(bfd *, struct bfd_link_info *, int, int, int, int, int); |
(bfd *, struct bfd_link_info *, int, int, int, int, int, int); |
|
|
/* ELF AArch64 mapping symbol support. */ |
/* ELF AArch64 mapping symbol support. */ |
#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) |
#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) |
Line 1436 typedef struct bfd_section |
|
Line 1432 typedef struct bfd_section |
|
when memory read flag isn't set. */ |
when memory read flag isn't set. */ |
#define SEC_COFF_NOREAD 0x40000000 |
#define SEC_COFF_NOREAD 0x40000000 |
|
|
|
/* Indicate that section has the no read flag set. */ |
|
#define SEC_ELF_NOREAD 0x80000000 |
|
|
/* End of section flags. */ |
/* End of section flags. */ |
|
|
/* Some internal packed boolean fields. */ |
/* Some internal packed boolean fields. */ |
Line 1502 typedef struct bfd_section |
|
Line 1501 typedef struct bfd_section |
|
information. */ |
information. */ |
bfd_vma lma; |
bfd_vma lma; |
|
|
/* The size of the section in octets, as it will be output. |
/* The size of the section in *octets*, as it will be output. |
Contains a value even if the section has no contents (e.g., the |
Contains a value even if the section has no contents (e.g., the |
size of <<.bss>>). */ |
size of <<.bss>>). */ |
bfd_size_type size; |
bfd_size_type size; |
Line 1953 enum bfd_architecture |
|
Line 1952 enum bfd_architecture |
|
#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ |
#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ |
#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ |
#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ |
#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ |
#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ |
|
#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ |
|
#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ |
|
#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ |
|
#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ |
|
#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ |
|
#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ |
|
#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ |
|
#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ |
|
#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ |
|
#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ |
/* Nonzero if MACH has the v9 instruction set. */ |
/* Nonzero if MACH has the v9 instruction set. */ |
#define bfd_mach_sparc_v9_p(mach) \ |
#define bfd_mach_sparc_v9_p(mach) \ |
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ |
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m \ |
&& (mach) != bfd_mach_sparc_sparclite_le) |
&& (mach) != bfd_mach_sparc_sparclite_le) |
/* Nonzero if MACH is a 64 bit sparc architecture. */ |
/* Nonzero if MACH is a 64 bit sparc architecture. */ |
#define bfd_mach_sparc_64bit_p(mach) \ |
#define bfd_mach_sparc_64bit_p(mach) \ |
((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) |
((mach) >= bfd_mach_sparc_v9 \ |
|
&& (mach) != bfd_mach_sparc_v8plusb \ |
|
&& (mach) != bfd_mach_sparc_v8plusc \ |
|
&& (mach) != bfd_mach_sparc_v8plusd \ |
|
&& (mach) != bfd_mach_sparc_v8pluse \ |
|
&& (mach) != bfd_mach_sparc_v8plusv \ |
|
&& (mach) != bfd_mach_sparc_v8plusm) |
bfd_arch_spu, /* PowerPC SPU */ |
bfd_arch_spu, /* PowerPC SPU */ |
#define bfd_mach_spu 256 |
#define bfd_mach_spu 256 |
bfd_arch_mips, /* MIPS Rxxxx */ |
bfd_arch_mips, /* MIPS Rxxxx */ |
Line 2990 to compensate for the borrow when the lo |
|
Line 3005 to compensate for the borrow when the lo |
|
BFD_RELOC_MICROMIPS_10_PCREL_S1, |
BFD_RELOC_MICROMIPS_10_PCREL_S1, |
BFD_RELOC_MICROMIPS_16_PCREL_S1, |
BFD_RELOC_MICROMIPS_16_PCREL_S1, |
|
|
|
/* MIPS16 PC-relative relocation. */ |
|
BFD_RELOC_MIPS16_16_PCREL_S1, |
|
|
/* MIPS PC-relative relocations. */ |
/* MIPS PC-relative relocations. */ |
BFD_RELOC_MIPS_21_PCREL_S2, |
BFD_RELOC_MIPS_21_PCREL_S2, |
BFD_RELOC_MIPS_26_PCREL_S2, |
BFD_RELOC_MIPS_26_PCREL_S2, |
Line 3523 pc-relative or some form of GOT-indirect |
|
Line 3541 pc-relative or some form of GOT-indirect |
|
/* ARM support for STT_GNU_IFUNC. */ |
/* ARM support for STT_GNU_IFUNC. */ |
BFD_RELOC_ARM_IRELATIVE, |
BFD_RELOC_ARM_IRELATIVE, |
|
|
|
/* Thumb1 relocations to support execute-only code. */ |
|
BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, |
|
BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, |
|
BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, |
|
BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, |
|
|
/* These relocs are only used within the ARM assembler. They are not |
/* These relocs are only used within the ARM assembler. They are not |
(at present) written to any object files. */ |
(at present) written to any object files. */ |
BFD_RELOC_ARM_IMMEDIATE, |
BFD_RELOC_ARM_IMMEDIATE, |
Line 3718 pc-relative or some form of GOT-indirect |
|
Line 3742 pc-relative or some form of GOT-indirect |
|
BFD_RELOC_ARC_TLS_LE_32, |
BFD_RELOC_ARC_TLS_LE_32, |
BFD_RELOC_ARC_S25W_PCREL_PLT, |
BFD_RELOC_ARC_S25W_PCREL_PLT, |
BFD_RELOC_ARC_S21H_PCREL_PLT, |
BFD_RELOC_ARC_S21H_PCREL_PLT, |
|
BFD_RELOC_ARC_NPS_CMEM16, |
|
|
/* ADI Blackfin 16 bit immediate absolute reloc. */ |
/* ADI Blackfin 16 bit immediate absolute reloc. */ |
BFD_RELOC_BFIN_16_IMM, |
BFD_RELOC_BFIN_16_IMM, |
Line 5618 BFD_RELOC_MACH_O_PAIR. */ |
|
Line 5643 BFD_RELOC_MACH_O_PAIR. */ |
|
/* Pair of relocation. Contains the first symbol. */ |
/* Pair of relocation. Contains the first symbol. */ |
BFD_RELOC_MACH_O_PAIR, |
BFD_RELOC_MACH_O_PAIR, |
|
|
|
/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ |
|
BFD_RELOC_MACH_O_SUBTRACTOR32, |
|
|
|
/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ |
|
BFD_RELOC_MACH_O_SUBTRACTOR64, |
|
|
/* PCREL relocations. They are marked as branch to create PLT entry if |
/* PCREL relocations. They are marked as branch to create PLT entry if |
required. */ |
required. */ |
BFD_RELOC_MACH_O_X86_64_BRANCH32, |
BFD_RELOC_MACH_O_X86_64_BRANCH32, |
|
|
the linker could optimize the movq to a leaq if possible. */ |
the linker could optimize the movq to a leaq if possible. */ |
BFD_RELOC_MACH_O_X86_64_GOT_LOAD, |
BFD_RELOC_MACH_O_X86_64_GOT_LOAD, |
|
|
/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ |
|
BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, |
|
|
|
/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ |
|
BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, |
|
|
|
/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ |
/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ |
BFD_RELOC_MACH_O_X86_64_PCREL32_1, |
BFD_RELOC_MACH_O_X86_64_PCREL32_1, |
|
|
Line 5645 the linker could optimize the movq to a |
|
Line 5670 the linker could optimize the movq to a |
|
/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ |
/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ |
BFD_RELOC_MACH_O_X86_64_PCREL32_4, |
BFD_RELOC_MACH_O_X86_64_PCREL32_4, |
|
|
|
/* Addend for PAGE or PAGEOFF. */ |
|
BFD_RELOC_MACH_O_ARM64_ADDEND, |
|
|
|
/* Relative offset to page of GOT slot. */ |
|
BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, |
|
|
|
/* Relative offset within page of GOT slot. */ |
|
BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, |
|
|
|
/* Address of a GOT entry. */ |
|
BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, |
|
|
/* This is a 32 bit reloc for the microblaze that stores the |
/* This is a 32 bit reloc for the microblaze that stores the |
low 16 bits of a value */ |
low 16 bits of a value */ |
BFD_RELOC_MICROBLAZE_32_LO, |
BFD_RELOC_MICROBLAZE_32_LO, |
Line 5735 important as several tables in the AArch |
|
Line 5772 important as several tables in the AArch |
|
by these enumerators; make sure they are all synced. */ |
by these enumerators; make sure they are all synced. */ |
BFD_RELOC_AARCH64_RELOC_START, |
BFD_RELOC_AARCH64_RELOC_START, |
|
|
|
/* Deprecated AArch64 null relocation code. */ |
|
BFD_RELOC_AARCH64_NULL, |
|
|
/* AArch64 null relocation code. */ |
/* AArch64 null relocation code. */ |
BFD_RELOC_AARCH64_NONE, |
BFD_RELOC_AARCH64_NONE, |
|
|
Line 6387 typedef struct bfd_symbol |
|
Line 6427 typedef struct bfd_symbol |
|
#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ |
#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ |
|
|
/* A normal C symbol would be one of: |
/* A normal C symbol would be one of: |
<<BSF_LOCAL>>, <<BSF_COMMON>>, <<BSF_UNDEFINED>> or |
<<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */ |
<<BSF_GLOBAL>>. */ |
|
|
|
/* The symbol is a debugging record. The value has an arbitrary |
/* The symbol is a debugging record. The value has an arbitrary |
meaning, unless BSF_DEBUGGING_RELOC is also set. */ |
meaning, unless BSF_DEBUGGING_RELOC is also set. */ |
Line 6400 typedef struct bfd_symbol |
|
Line 6439 typedef struct bfd_symbol |
|
|
|
/* Used by the linker. */ |
/* Used by the linker. */ |
#define BSF_KEEP (1 << 5) |
#define BSF_KEEP (1 << 5) |
#define BSF_KEEP_G (1 << 6) |
|
|
/* An ELF common symbol. */ |
|
#define BSF_ELF_COMMON (1 << 6) |
|
|
/* A weak global symbol, overridable without warnings by |
/* A weak global symbol, overridable without warnings by |
a regular global symbol of the same name. */ |
a regular global symbol of the same name. */ |
Line 6547 enum bfd_direction |
|
Line 6588 enum bfd_direction |
|
|
|
enum bfd_plugin_format |
enum bfd_plugin_format |
{ |
{ |
bfd_plugin_uknown = 0, |
bfd_plugin_unknown = 0, |
bfd_plugin_yes = 1, |
bfd_plugin_yes = 1, |
bfd_plugin_no = 2 |
bfd_plugin_no = 2 |
}; |
}; |
|
|
ENUM_BITFIELD (bfd_direction) direction : 2; |
ENUM_BITFIELD (bfd_direction) direction : 2; |
|
|
/* Format_specific flags. */ |
/* Format_specific flags. */ |
flagword flags : 18; |
flagword flags : 20; |
|
|
/* Values that may appear in the flags field of a BFD. These also |
/* Values that may appear in the flags field of a BFD. These also |
appear in the object_flags field of the bfd_target structure, where |
appear in the object_flags field of the bfd_target structure, where |
|
|
/* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ |
/* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ |
#define BFD_COMPRESS_GABI 0x20000 |
#define BFD_COMPRESS_GABI 0x20000 |
|
|
|
/* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this |
|
BFD. */ |
|
#define BFD_CONVERT_ELF_COMMON 0x40000 |
|
|
|
/* Use the ELF STT_COMMON type in this BFD. */ |
|
#define BFD_USE_ELF_STT_COMMON 0x80000 |
|
|
/* Flags bits to be saved in bfd_preserve_save. */ |
/* Flags bits to be saved in bfd_preserve_save. */ |
#define BFD_FLAGS_SAVED \ |
#define BFD_FLAGS_SAVED \ |
(BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN \ |
(BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN \ |
| BFD_COMPRESS_GABI) |
| BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) |
|
|
/* Flags bits which are for BFD use only. */ |
/* Flags bits which are for BFD use only. */ |
#define BFD_FLAGS_FOR_BFD_USE_MASK \ |
#define BFD_FLAGS_FOR_BFD_USE_MASK \ |
(BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ |
(BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ |
| BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ |
| BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ |
| BFD_COMPRESS_GABI) |
| BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) |
|
|
/* Is the file descriptor being cached? That is, can it be closed as |
/* Is the file descriptor being cached? That is, can it be closed as |
needed, and re-opened when accessed later? */ |
needed, and re-opened when accessed later? */ |
Line 7424 typedef struct bfd_target |
|
Line 7472 typedef struct bfd_target |
|
NAME##_bfd_copy_link_hash_symbol_type, \ |
NAME##_bfd_copy_link_hash_symbol_type, \ |
NAME##_bfd_final_link, \ |
NAME##_bfd_final_link, \ |
NAME##_bfd_link_split_section, \ |
NAME##_bfd_link_split_section, \ |
|
NAME##_bfd_link_check_relocs, \ |
NAME##_bfd_gc_sections, \ |
NAME##_bfd_gc_sections, \ |
NAME##_bfd_lookup_section_flags, \ |
NAME##_bfd_lookup_section_flags, \ |
NAME##_bfd_merge_sections, \ |
NAME##_bfd_merge_sections, \ |
Line 7465 typedef struct bfd_target |
|
Line 7514 typedef struct bfd_target |
|
/* Should this section be split up into smaller pieces during linking. */ |
/* Should this section be split up into smaller pieces during linking. */ |
bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); |
bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); |
|
|
|
/* Check the relocations in the bfd for validity. */ |
|
bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); |
|
|
/* Remove sections that are not referenced from the output. */ |
/* Remove sections that are not referenced from the output. */ |
bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); |
bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); |
|
|
Line 7577 struct bfd_elf_version_tree * bfd_find_v |
|
Line 7629 struct bfd_elf_version_tree * bfd_find_v |
|
bfd_boolean bfd_hide_sym_by_version |
bfd_boolean bfd_hide_sym_by_version |
(struct bfd_elf_version_tree *verdefs, const char *sym_name); |
(struct bfd_elf_version_tree *verdefs, const char *sym_name); |
|
|
|
bfd_boolean bfd_link_check_relocs |
|
(bfd *abfd, struct bfd_link_info *info); |
|
|
|
bfd_boolean _bfd_generic_link_check_relocs |
|
(bfd *abfd, struct bfd_link_info *info); |
|
|
/* Extracted from simple.c. */ |
/* Extracted from simple.c. */ |
bfd_byte *bfd_simple_get_relocated_section_contents |
bfd_byte *bfd_simple_get_relocated_section_contents |
(bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); |
(bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); |