tic4x: sign extension using shifts
[deliverable/binutils-gdb.git] / bfd / targets.c
index 158168cb3ba275df2efaefed2e33543bbf709c40..1b7e29d1e6eb8c7c7058a42c7a7e8678fe2f5670 100644 (file)
@@ -1,5 +1,5 @@
 /* Generic target-file-type support for the BFD library.
 /* Generic target-file-type support for the BFD library.
-   Copyright (C) 1990-2019 Free Software Foundation, Inc.
+   Copyright (C) 1990-2020 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -179,7 +179,7 @@ DESCRIPTION
 .typedef struct bfd_target
 .{
 .  {* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  *}
 .typedef struct bfd_target
 .{
 .  {* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  *}
-.  char *name;
+.  const 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.  *}
@@ -462,6 +462,7 @@ BFD_JUMP_TABLE macros.
 .  NAME##_bfd_lookup_section_flags, \
 .  NAME##_bfd_merge_sections, \
 .  NAME##_bfd_is_group_section, \
 .  NAME##_bfd_lookup_section_flags, \
 .  NAME##_bfd_merge_sections, \
 .  NAME##_bfd_is_group_section, \
+.  NAME##_bfd_group_name, \
 .  NAME##_bfd_discard_group, \
 .  NAME##_section_already_linked, \
 .  NAME##_bfd_define_common_symbol, \
 .  NAME##_bfd_discard_group, \
 .  NAME##_section_already_linked, \
 .  NAME##_bfd_define_common_symbol, \
@@ -520,6 +521,9 @@ BFD_JUMP_TABLE macros.
 .  {* Is this section a member of a group?  *}
 .  bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
 .
 .  {* Is this section a member of a group?  *}
 .  bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
 .
+.  {* The group name, if section is a member of a group.  *}
+.  const char *(*_bfd_group_name) (bfd *, const struct bfd_section *);
+.
 .  {* Discard members of a group.  *}
 .  bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
 .
 .  {* Discard members of a group.  *}
 .  bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
 .
@@ -580,6 +584,74 @@ to find an alternative output format that is suitable.
 .
 .} bfd_target;
 .
 .
 .} bfd_target;
 .
+.static inline const char *
+.bfd_get_target (const bfd *abfd)
+.{
+.  return abfd->xvec->name;
+.}
+.
+.static inline enum bfd_flavour
+.bfd_get_flavour (const bfd *abfd)
+.{
+.  return abfd->xvec->flavour;
+.}
+.
+.static inline flagword
+.bfd_applicable_file_flags (const bfd *abfd)
+.{
+.  return abfd->xvec->object_flags;
+.}
+.
+.static inline bfd_boolean
+.bfd_family_coff (const bfd *abfd)
+.{
+.  return (bfd_get_flavour (abfd) == bfd_target_coff_flavour
+.          || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour);
+.}
+.
+.static inline bfd_boolean
+.bfd_big_endian (const bfd *abfd)
+.{
+.  return abfd->xvec->byteorder == BFD_ENDIAN_BIG;
+.}
+.static inline bfd_boolean
+.bfd_little_endian (const bfd *abfd)
+.{
+.  return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE;
+.}
+.
+.static inline bfd_boolean
+.bfd_header_big_endian (const bfd *abfd)
+.{
+.  return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG;
+.}
+.
+.static inline bfd_boolean
+.bfd_header_little_endian (const bfd *abfd)
+.{
+.  return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE;
+.}
+.
+.static inline flagword
+.bfd_applicable_section_flags (const bfd *abfd)
+.{
+.  return abfd->xvec->section_flags;
+.}
+.
+.static inline char
+.bfd_get_symbol_leading_char (const bfd *abfd)
+.{
+.  return abfd->xvec->symbol_leading_char;
+.}
+.
+.static inline enum bfd_flavour
+.bfd_asymbol_flavour (const asymbol *sy)
+.{
+.  if ((sy->flags & BSF_SYNTHETIC) != 0)
+.    return bfd_target_unknown_flavour;
+.  return sy->the_bfd->xvec->flavour;
+.}
+.
 */
 
 /* All known xvecs (even those that don't compile on all systems).
 */
 
 /* All known xvecs (even those that don't compile on all systems).
@@ -625,7 +697,6 @@ extern const bfd_target avr_elf32_vec;
 extern const bfd_target bfin_elf32_vec;
 extern const bfd_target bfin_elf32_fdpic_vec;
 extern const bfd_target cr16_elf32_vec;
 extern const bfd_target bfin_elf32_vec;
 extern const bfd_target bfin_elf32_fdpic_vec;
 extern const bfd_target cr16_elf32_vec;
-extern const bfd_target cr16c_elf32_vec;
 extern const bfd_target cris_aout_vec;
 extern const bfd_target cris_elf32_vec;
 extern const bfd_target cris_elf32_us_vec;
 extern const bfd_target cris_aout_vec;
 extern const bfd_target cris_elf32_vec;
 extern const bfd_target cris_elf32_us_vec;
@@ -639,6 +710,8 @@ extern const bfd_target elf32_be_vec;
 extern const bfd_target elf32_le_vec;
 extern const bfd_target elf64_be_vec;
 extern const bfd_target elf64_le_vec;
 extern const bfd_target elf32_le_vec;
 extern const bfd_target elf64_be_vec;
 extern const bfd_target elf64_le_vec;
+extern const bfd_target bpf_elf64_le_vec;
+extern const bfd_target bpf_elf64_be_vec;
 extern const bfd_target epiphany_elf32_vec;
 extern const bfd_target fr30_elf32_vec;
 extern const bfd_target frv_elf32_vec;
 extern const bfd_target epiphany_elf32_vec;
 extern const bfd_target fr30_elf32_vec;
 extern const bfd_target frv_elf32_vec;
@@ -826,7 +899,6 @@ extern const bfd_target tic6x_elf32_c6000_be_vec;
 extern const bfd_target tic6x_elf32_c6000_le_vec;
 extern const bfd_target tic6x_elf32_linux_be_vec;
 extern const bfd_target tic6x_elf32_linux_le_vec;
 extern const bfd_target tic6x_elf32_c6000_le_vec;
 extern const bfd_target tic6x_elf32_linux_be_vec;
 extern const bfd_target tic6x_elf32_linux_le_vec;
-extern const bfd_target tic80_coff_vec;
 extern const bfd_target tilegx_elf32_be_vec;
 extern const bfd_target tilegx_elf32_le_vec;
 extern const bfd_target tilegx_elf64_be_vec;
 extern const bfd_target tilegx_elf32_be_vec;
 extern const bfd_target tilegx_elf32_le_vec;
 extern const bfd_target tilegx_elf64_be_vec;
@@ -859,6 +931,7 @@ extern const bfd_target xstormy16_elf32_vec;
 extern const bfd_target xtensa_elf32_be_vec;
 extern const bfd_target xtensa_elf32_le_vec;
 extern const bfd_target z80_coff_vec;
 extern const bfd_target xtensa_elf32_be_vec;
 extern const bfd_target xtensa_elf32_le_vec;
 extern const bfd_target z80_coff_vec;
+extern const bfd_target z80_elf32_vec;
 extern const bfd_target z8k_coff_vec;
 
 /* These are always included.  */
 extern const bfd_target z8k_coff_vec;
 
 /* These are always included.  */
@@ -955,7 +1028,6 @@ static const bfd_target * const _bfd_target_vector[] =
        &bfin_elf32_fdpic_vec,
 
        &cr16_elf32_vec,
        &bfin_elf32_fdpic_vec,
 
        &cr16_elf32_vec,
-       &cr16c_elf32_vec,
 
        &cris_aout_vec,
        &cris_elf32_vec,
 
        &cris_aout_vec,
        &cris_elf32_vec,
@@ -1020,6 +1092,11 @@ static const bfd_target * const _bfd_target_vector[] =
 
        &iamcu_elf32_vec,
 
 
        &iamcu_elf32_vec,
 
+#ifdef BFD64
+       &bpf_elf64_be_vec,
+       &bpf_elf64_le_vec,
+#endif
+
 #ifdef BFD64
 #if 0
        &ia64_elf32_be_vec,
 #ifdef BFD64
 #if 0
        &ia64_elf32_be_vec,
@@ -1142,10 +1219,6 @@ static const bfd_target * const _bfd_target_vector[] =
        &pj_elf32_vec,
        &pj_elf32_le_vec,
 
        &pj_elf32_vec,
        &pj_elf32_le_vec,
 
-#if BFD_SUPPORTS_PLUGINS
-       &plugin_vec,
-#endif
-
        &powerpc_boot_vec,
        &powerpc_elf32_vec,
        &powerpc_elf32_le_vec,
        &powerpc_boot_vec,
        &powerpc_elf32_vec,
        &powerpc_elf32_le_vec,
@@ -1233,7 +1306,6 @@ static const bfd_target * const _bfd_target_vector[] =
        &tic54x_coff2_vec,
        &tic6x_elf32_be_vec,
        &tic6x_elf32_le_vec,
        &tic54x_coff2_vec,
        &tic6x_elf32_be_vec,
        &tic6x_elf32_le_vec,
-       &tic80_coff_vec,
 
        &tilegx_elf32_be_vec,
        &tilegx_elf32_le_vec,
 
        &tilegx_elf32_be_vec,
        &tilegx_elf32_le_vec,
@@ -1282,6 +1354,7 @@ static const bfd_target * const _bfd_target_vector[] =
        &xtensa_elf32_le_vec,
 
        &z80_coff_vec,
        &xtensa_elf32_le_vec,
 
        &z80_coff_vec,
+       &z80_elf32_vec,
 
        &z8k_coff_vec,
 #endif /* not SELECT_VECS */
 
        &z8k_coff_vec,
 #endif /* not SELECT_VECS */
@@ -1298,6 +1371,10 @@ static const bfd_target * const _bfd_target_vector[] =
 /* Likewise for ihex.  */
        &ihex_vec,
 
 /* Likewise for ihex.  */
        &ihex_vec,
 
+#if BFD_SUPPORTS_PLUGINS
+       &plugin_vec,
+#endif
+
 /* Add any required traditional-core-file-handler.  */
 
 #ifdef AIX386_CORE
 /* Add any required traditional-core-file-handler.  */
 
 #ifdef AIX386_CORE
This page took 0.028736 seconds and 4 git commands to generate.