Add QNX Neutrino PowerPC support and common up QNX functions
[deliverable/binutils-gdb.git] / bfd / targets.c
index a86267e0992a880cc97258506f3d4f3ddbde38d9..ee378284da540c0cb985ef9e9fa2c8aea0e4e233 100644 (file)
@@ -1,6 +1,6 @@
 /* Generic target-file-type support for the BFD library.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001
+   2000, 2001, 2002
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -125,7 +125,7 @@ DESCRIPTION
 .   (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
 .   (bfd_assert (__FILE__,__LINE__), NULL))
 .#endif
-
+.
        This is the structure which defines the type of BFD this is.  The
        <<xvec>> member of the struct <<bfd>> itself points here.  Each
        module that implements access to a different target under BFD,
@@ -135,7 +135,8 @@ DESCRIPTION
        the entry points which call them. Too bad we can't have one
        macro to define them both!
 
-.enum bfd_flavour {
+.enum bfd_flavour
+.{
 .  bfd_target_unknown_flavour,
 .  bfd_target_aout_flavour,
 .  bfd_target_coff_flavour,
@@ -153,7 +154,8 @@ DESCRIPTION
 .  bfd_target_versados_flavour,
 .  bfd_target_msdos_flavour,
 .  bfd_target_ovax_flavour,
-.  bfd_target_evax_flavour
+.  bfd_target_evax_flavour,
+.  bfd_target_mmo_flavour
 .};
 .
 .enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
@@ -163,51 +165,40 @@ DESCRIPTION
 .
 .typedef struct bfd_target
 .{
-
-Identifies the kind of target, e.g., SunOS4, Ultrix, etc.
-
+.  {* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  *}
 .  char *name;
-
-The "flavour" of a back end is a general indication about the contents
-of a file.
-
+.
+. {* The "flavour" of a back end is a general indication about
+.    the contents of a file.  *}
 .  enum bfd_flavour flavour;
-
-The order of bytes within the data area of a file.
-
+.
+.  {* The order of bytes within the data area of a file.  *}
 .  enum bfd_endian byteorder;
-
-The order of bytes within the header parts of a file.
-
+.
+. {* The order of bytes within the header parts of a file.  *}
 .  enum bfd_endian header_byteorder;
-
-A mask of all the flags which an executable may have set -
-from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.
-
+.
+.  {* A mask of all the flags which an executable may have set -
+.     from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.  *}
 .  flagword object_flags;
-
-A mask of all the flags which a section may have set - from
-the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.
-
+.
+. {* A mask of all the flags which a section may have set - from
+.    the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.  *}
 .  flagword section_flags;
-
-The character normally found at the front of a symbol
-(if any), perhaps `_'.
-
+.
+. {* The character normally found at the front of a symbol.
+.    (if any), perhaps `_'.  *}
 .  char symbol_leading_char;
-
-The pad character for file names within an archive header.
-
+.
+. {* The pad character for file names within an archive header.  *}
 .  char ar_pad_char;
-
-The maximum number of characters in an archive header.
-
+.
+.  {* The maximum number of characters in an archive header.  *}
 .  unsigned short ar_max_namelen;
-
-Entries for byte swapping for data. These are different from the other
-entry points, since they don't take a BFD asthe first argument.
-Certain other handlers could do the same.
-
+.
+.  {* Entries for byte swapping for data. These are different from the
+.     other entry points, since they don't take a BFD asthe first argument.
+.     Certain other handlers could do the same.  *}
 .  bfd_vma        (*bfd_getx64) PARAMS ((const bfd_byte *));
 .  bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *));
 .  void           (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
@@ -217,9 +208,8 @@ Certain other handlers could do the same.
 .  bfd_vma        (*bfd_getx16) PARAMS ((const bfd_byte *));
 .  bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *));
 .  void           (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
-
-Byte swapping for the headers
-
+.
+.  {* Byte swapping for the headers.  *}
 .  bfd_vma        (*bfd_h_getx64) PARAMS ((const bfd_byte *));
 .  bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *));
 .  void           (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
@@ -229,25 +219,21 @@ Byte swapping for the headers
 .  bfd_vma        (*bfd_h_getx16) PARAMS ((const bfd_byte *));
 .  bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *));
 .  void           (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
-
-Format dependent routines: these are vectors of entry points
-within the target vector structure, one for each format to check.
-
-Check the format of a file being read.  Return a <<bfd_target *>> or zero.
-
+.
+.  {* Format dependent routines: these are vectors of entry points
+.     within the target vector structure, one for each format to check.  *}
+.
+.  {* Check the format of a file being read.  Return a <<bfd_target *>> or zero.  *}
 .  const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
-
-Set the format of a file being written.
-
+.
+.  {* Set the format of a file being written.  *}
 .  boolean  (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
-
-Write cached information into a file being written, at <<bfd_close>>.
-
+.
+.  {* Write cached information into a file being written, at <<bfd_close>>.  *}
 .  boolean  (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
-
+.
 The general target vector.  These vectors are initialized using the
 BFD_JUMP_TABLE macros.
-
 .
 .  {* Generic entry points.  *}
 Do not "beautify" the CONCAT* macro args.  Traditional C will not
@@ -294,10 +280,10 @@ the tokens.
 .     to another.  *}
 .  boolean  (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
 .                                                     bfd *, asymbol *));
-.  {* Called to set private backend flags *}
+.  {* Called to set private backend flags *}
 .  boolean  (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
 .
-.  {* Called to print private BFD data *}
+.  {* Called to print private BFD data *}
 .  boolean  (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
 .
 .  {* Core file entry points.  *}
@@ -408,11 +394,14 @@ the tokens.
 .CONCAT2 (NAME,_bfd_get_relocated_section_contents), \
 .CONCAT2 (NAME,_bfd_relax_section), \
 .CONCAT2 (NAME,_bfd_link_hash_table_create), \
+.CONCAT2 (NAME,_bfd_link_hash_table_free), \
 .CONCAT2 (NAME,_bfd_link_add_symbols), \
+.CONCAT2 (NAME,_bfd_link_just_syms), \
 .CONCAT2 (NAME,_bfd_final_link), \
 .CONCAT2 (NAME,_bfd_link_split_section), \
 .CONCAT2 (NAME,_bfd_gc_sections), \
-.CONCAT2 (NAME,_bfd_merge_sections)
+.CONCAT2 (NAME,_bfd_merge_sections), \
+.CONCAT2 (NAME,_bfd_discard_group)
 .  int      (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
 .  bfd_byte *(*_bfd_get_relocated_section_contents)
 .    PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
@@ -425,9 +414,15 @@ the tokens.
 .     different information in this table.  *}
 .  struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
 .
+.  {* Release the memory associated with the linker hash table.  *}
+.  void (*_bfd_link_hash_table_free) PARAMS ((struct bfd_link_hash_table *));
+.
 .  {* Add symbols from this object file into the hash table.  *}
 .  boolean  (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
 .
+.  {* Indicate that we are only retrieving symbol values from this section.  *}
+.  void     (*_bfd_link_just_syms) PARAMS ((asection *, struct bfd_link_info *));
+.
 .  {* Do a link based on the link_order structures attached to each
 .     section of the BFD.  *}
 .  boolean  (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
@@ -441,13 +436,16 @@ the tokens.
 .  {* Attempt to merge SEC_MERGE sections.  *}
 .  boolean  (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *));
 .
+.  {* Discard members of a group.  *}
+.  boolean  (*_bfd_discard_group) PARAMS ((bfd *, struct sec *));
+.
 .  {* Routines to handle dynamic symbols and relocs.  *}
 .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
 .CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \
 .CONCAT2 (NAME,_canonicalize_dynamic_symtab), \
 .CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \
 .CONCAT2 (NAME,_canonicalize_dynamic_reloc)
-.  {* Get the amount of memory required to hold the dynamic symbols. *}
+.  {* Get the amount of memory required to hold the dynamic symbols.  *}
 .  long     (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
 .  {* Read in the dynamic symbols.  *}
 .  long     (*_bfd_canonicalize_dynamic_symtab)
@@ -465,17 +463,16 @@ and little endian code, and target chosen by the linker has the wrong
 endianness.  The function open_output() in ld/ldlang.c uses this field
 to find an alternative output format that is suitable.
 
-. {* Opposite endian version of this target.  *}
-. const struct bfd_target * alternative_target;
+.  {* Opposite endian version of this target.  *}
+.  const struct bfd_target * alternative_target;
 .
 
-Data for use by back-end routines, which isn't generic enough to belong
-in this structure.
-
-. PTR backend_data;
+.  {* Data for use by back-end routines, which isn't
+.     generic enough to belong in this structure.  *}
+.  PTR backend_data;
 .
 .} bfd_target;
-
+.
 */
 
 /* All known xvecs (even those that don't compile on all systems).
@@ -484,6 +481,7 @@ in this structure.
    we can't intermix extern's and initializers.  */
 extern const bfd_target a29kcoff_big_vec;
 extern const bfd_target a_out_adobe_vec;
+extern const bfd_target aix5coff64_vec;
 extern const bfd_target aout0_big_vec;
 extern const bfd_target aout_arm_big_vec;
 extern const bfd_target aout_arm_little_vec;
@@ -510,24 +508,31 @@ extern const bfd_target bfd_elf32_big_generic_vec;
 extern const bfd_target bfd_elf32_bigarc_vec;
 extern const bfd_target bfd_elf32_bigarm_oabi_vec;
 extern const bfd_target bfd_elf32_bigarm_vec;
+extern const bfd_target bfd_elf32_bigarmqnx_vec;
 extern const bfd_target bfd_elf32_bigmips_vec;
 extern const bfd_target bfd_elf32_cris_vec;
 extern const bfd_target bfd_elf32_d10v_vec;
 extern const bfd_target bfd_elf32_d30v_vec;
+extern const bfd_target bfd_elf32_dlx_big_vec;
 extern const bfd_target bfd_elf32_fr30_vec;
+extern const bfd_target bfd_elf32_frv_vec;
 extern const bfd_target bfd_elf32_h8300_vec;
 extern const bfd_target bfd_elf32_hppa_linux_vec;
 extern const bfd_target bfd_elf32_hppa_vec;
 extern const bfd_target bfd_elf32_i370_vec;
 extern const bfd_target bfd_elf32_i386_vec;
+extern const bfd_target bfd_elf32_i386qnx_vec;
 extern const bfd_target bfd_elf32_i860_little_vec;
 extern const bfd_target bfd_elf32_i860_vec;
 extern const bfd_target bfd_elf32_i960_vec;
 extern const bfd_target bfd_elf32_ia64_big_vec;
+extern const bfd_target bfd_elf32_ia64_hpux_big_vec;
+extern const bfd_target bfd_elf32_ip2k_vec;
 extern const bfd_target bfd_elf32_little_generic_vec;
 extern const bfd_target bfd_elf32_littlearc_vec;
 extern const bfd_target bfd_elf32_littlearm_oabi_vec;
 extern const bfd_target bfd_elf32_littlearm_vec;
+extern const bfd_target bfd_elf32_littlearmqnx_vec;
 extern const bfd_target bfd_elf32_littlemips_vec;
 extern const bfd_target bfd_elf32_m32r_vec;
 extern const bfd_target bfd_elf32_m68hc11_vec;
@@ -538,21 +543,36 @@ extern const bfd_target bfd_elf32_mcore_big_vec;
 extern const bfd_target bfd_elf32_mcore_little_vec;
 extern const bfd_target bfd_elf32_mn10200_vec;
 extern const bfd_target bfd_elf32_mn10300_vec;
+extern const bfd_target bfd_elf32_nbigmips_vec;
+extern const bfd_target bfd_elf32_nlittlemips_vec;
+extern const bfd_target bfd_elf32_ntradbigmips_vec;
+extern const bfd_target bfd_elf32_ntradlittlemips_vec;
 extern const bfd_target bfd_elf32_openrisc_vec;
+extern const bfd_target bfd_elf32_or32_big_vec;
 extern const bfd_target bfd_elf32_pj_vec;
 extern const bfd_target bfd_elf32_pjl_vec;
 extern const bfd_target bfd_elf32_powerpc_vec;
 extern const bfd_target bfd_elf32_powerpcle_vec;
+extern const bfd_target bfd_elf32_powerpcleqnx_vec;
+extern const bfd_target bfd_elf32_powerpcqnx_vec;
 extern const bfd_target bfd_elf32_s390_vec;
+extern const bfd_target bfd_elf32_sh64_vec;
+extern const bfd_target bfd_elf32_sh64l_vec;
+extern const bfd_target bfd_elf32_sh64lnbsd_vec;
+extern const bfd_target bfd_elf32_sh64nbsd_vec;
 extern const bfd_target bfd_elf32_sh_vec;
 extern const bfd_target bfd_elf32_shblin_vec;
 extern const bfd_target bfd_elf32_shl_vec;
 extern const bfd_target bfd_elf32_shlin_vec;
+extern const bfd_target bfd_elf32_shlnbsd_vec;
+extern const bfd_target bfd_elf32_shnbsd_vec;
 extern const bfd_target bfd_elf32_sparc_vec;
 extern const bfd_target bfd_elf32_tradbigmips_vec;
 extern const bfd_target bfd_elf32_tradlittlemips_vec;
 extern const bfd_target bfd_elf32_us_cris_vec;
 extern const bfd_target bfd_elf32_v850_vec;
+extern const bfd_target bfd_elf32_vax_vec;
+extern const bfd_target bfd_elf32_xstormy16_vec;
 extern const bfd_target bfd_elf64_alpha_vec;
 extern const bfd_target bfd_elf64_big_generic_vec;
 extern const bfd_target bfd_elf64_bigmips_vec;
@@ -561,16 +581,23 @@ extern const bfd_target bfd_elf64_hppa_vec;
 extern const bfd_target bfd_elf64_ia64_aix_big_vec;
 extern const bfd_target bfd_elf64_ia64_aix_little_vec;
 extern const bfd_target bfd_elf64_ia64_big_vec;
+extern const bfd_target bfd_elf64_ia64_hpux_big_vec;
 extern const bfd_target bfd_elf64_ia64_little_vec;
 extern const bfd_target bfd_elf64_little_generic_vec;
 extern const bfd_target bfd_elf64_littlemips_vec;
+extern const bfd_target bfd_elf64_mmix_vec;
 extern const bfd_target bfd_elf64_powerpc_vec;
 extern const bfd_target bfd_elf64_powerpcle_vec;
 extern const bfd_target bfd_elf64_s390_vec;
+extern const bfd_target bfd_elf64_sh64_vec;
+extern const bfd_target bfd_elf64_sh64l_vec;
+extern const bfd_target bfd_elf64_sh64lnbsd_vec;
+extern const bfd_target bfd_elf64_sh64nbsd_vec;
 extern const bfd_target bfd_elf64_sparc_vec;
 extern const bfd_target bfd_elf64_tradbigmips_vec;
 extern const bfd_target bfd_elf64_tradlittlemips_vec;
 extern const bfd_target bfd_elf64_x86_64_vec;
+extern const bfd_target bfd_mmo_vec;
 extern const bfd_target bfd_powerpc_pe_vec;
 extern const bfd_target bfd_powerpc_pei_vec;
 extern const bfd_target bfd_powerpcle_pe_vec;
@@ -629,6 +656,7 @@ extern const bfd_target nlm32_i386_vec;
 extern const bfd_target nlm32_powerpc_vec;
 extern const bfd_target nlm32_sparc_vec;
 extern const bfd_target oasys_vec;
+extern const bfd_target or32coff_big_vec;
 extern const bfd_target pc532machaout_vec;
 extern const bfd_target pc532netbsd_vec;
 extern const bfd_target pdp11_aout_vec;
@@ -660,7 +688,9 @@ extern const bfd_target tic54x_coff1_vec;
 extern const bfd_target tic54x_coff2_beh_vec;
 extern const bfd_target tic54x_coff2_vec;
 extern const bfd_target tic80coff_vec;
+extern const bfd_target vaxbsd_vec;
 extern const bfd_target vaxnetbsd_vec;
+extern const bfd_target vax1knetbsd_vec;
 extern const bfd_target versados_vec;
 extern const bfd_target vms_alpha_vec;
 extern const bfd_target vms_vax_vec;
@@ -707,6 +737,9 @@ static const bfd_target * const _bfd_target_vector[] = {
           it wasn't omitted by mistake.  */
        &a29kcoff_big_vec,
        &a_out_adobe_vec,
+#ifdef BFD64
+       &aix5coff64_vec,
+#endif
        &aout0_big_vec,
 #if 0
        /* We have no way of distinguishing these from other a.out variants */
@@ -750,17 +783,23 @@ static const bfd_target * const _bfd_target_vector[] = {
        &bfd_elf32_cris_vec,
        &bfd_elf32_d10v_vec,
        &bfd_elf32_d30v_vec,
+       &bfd_elf32_dlx_big_vec,
        &bfd_elf32_fr30_vec,
+       &bfd_elf32_frv_vec,
+       &bfd_elf32_h8300_vec,
        &bfd_elf32_hppa_linux_vec,
        &bfd_elf32_hppa_vec,
        &bfd_elf32_i370_vec,
        &bfd_elf32_i386_vec,
+       &bfd_elf32_i386qnx_vec,
        &bfd_elf32_i860_little_vec,
        &bfd_elf32_i860_vec,
        &bfd_elf32_i960_vec,
 #if 0
        &bfd_elf32_ia64_big_vec,
 #endif
+       &bfd_elf32_ia64_hpux_big_vec,
+       &bfd_elf32_ip2k_vec,
        &bfd_elf32_little_generic_vec,
        &bfd_elf32_littlearc_vec,
        &bfd_elf32_littlearm_oabi_vec,
@@ -775,21 +814,40 @@ static const bfd_target * const _bfd_target_vector[] = {
        &bfd_elf32_mcore_little_vec,
        &bfd_elf32_mn10200_vec,
        &bfd_elf32_mn10300_vec,
+#ifdef BFD64
+       &bfd_elf32_nbigmips_vec,
+       &bfd_elf32_nlittlemips_vec,
+       &bfd_elf32_ntradbigmips_vec,
+       &bfd_elf32_ntradlittlemips_vec,
+#endif
        &bfd_elf32_openrisc_vec,
+       &bfd_elf32_or32_big_vec,
        &bfd_elf32_pj_vec,
        &bfd_elf32_pjl_vec,
        &bfd_elf32_powerpc_vec,
        &bfd_elf32_powerpcle_vec,
+       &bfd_elf32_powerpcleqnx_vec,
+       &bfd_elf32_powerpcqnx_vec,
        &bfd_elf32_s390_vec,
         &bfd_elf32_sh_vec,
         &bfd_elf32_shblin_vec,
         &bfd_elf32_shl_vec,
         &bfd_elf32_shlin_vec,
+       &bfd_elf32_shlnbsd_vec,
+       &bfd_elf32_shnbsd_vec,
+#ifdef BFD64
+       &bfd_elf32_sh64_vec,
+       &bfd_elf32_sh64l_vec,
+       &bfd_elf32_sh64lnbsd_vec,
+       &bfd_elf32_sh64nbsd_vec,
+#endif
        &bfd_elf32_sparc_vec,
        &bfd_elf32_tradbigmips_vec,
        &bfd_elf32_tradlittlemips_vec,
        &bfd_elf32_us_cris_vec,
        &bfd_elf32_v850_vec,
+       &bfd_elf32_vax_vec,
+       &bfd_elf32_xstormy16_vec,
 #ifdef BFD64
        &bfd_elf64_alpha_vec,
        &bfd_elf64_big_generic_vec,
@@ -799,18 +857,25 @@ static const bfd_target * const _bfd_target_vector[] = {
        &bfd_elf64_ia64_aix_big_vec,
        &bfd_elf64_ia64_aix_little_vec,
        &bfd_elf64_ia64_big_vec,
+       &bfd_elf64_ia64_hpux_big_vec,
        &bfd_elf64_ia64_little_vec,
        &bfd_elf64_little_generic_vec,
        &bfd_elf64_littlemips_vec,
+       &bfd_elf64_mmix_vec,
        &bfd_elf64_powerpc_vec,
        &bfd_elf64_powerpcle_vec,
        &bfd_elf64_s390_vec,
+       &bfd_elf64_sh64_vec,
+       &bfd_elf64_sh64l_vec,
+       &bfd_elf64_sh64lnbsd_vec,
+       &bfd_elf64_sh64nbsd_vec,
 #if 0
        &bfd_elf64_sparc_vec,
 #endif
        &bfd_elf64_tradbigmips_vec,
        &bfd_elf64_tradlittlemips_vec,
        &bfd_elf64_x86_64_vec,
+       &bfd_mmo_vec, 
 #endif
        &bfd_powerpc_pe_vec,
        &bfd_powerpc_pei_vec,
@@ -903,6 +968,9 @@ static const bfd_target * const _bfd_target_vector[] = {
           can be annoying target mis-matches.  */
        &oasys_vec,
 #endif
+       /* Entry for the OpenRISC family.  */
+       &or32coff_big_vec,
+
        &pc532machaout_vec,
        &pc532netbsd_vec,
        &pdp11_aout_vec,
@@ -944,7 +1012,9 @@ static const bfd_target * const _bfd_target_vector[] = {
        &tic54x_coff2_beh_vec,
        &tic54x_coff2_vec,
        &tic80coff_vec,
+       &vaxbsd_vec,
        &vaxnetbsd_vec,
+       &vax1knetbsd_vec,
        &versados_vec,
 #ifdef BFD64
        &vms_alpha_vec,
This page took 0.0288 seconds and 4 git commands to generate.