Don't use bfd_get_* macro to set bfd fields
[deliverable/binutils-gdb.git] / bfd / bfd-in2.h
index 7e6dad78d450b3b555bed9a0994d25fcb2d2da01..aec2143ea605ef85251d2c5f2fb20b66be14b39e 100644 (file)
@@ -264,7 +264,7 @@ typedef unsigned long symindex;
 /* This is a type pun with struct ranlib on purpose!  */
 typedef struct carsym
 {
-  char *name;
+  const char *name;
   file_ptr file_offset;        /* Look here to find the file.  */
 }
 carsym;                        /* To make these you call a carsymogen.  */
@@ -525,9 +525,7 @@ extern int bfd_stat (bfd *, struct stat *);
 #endif
 extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
 
-/* Cast from const char * to char * so that caller can assign to
-   a char * without a warning.  */
-#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
+#define bfd_get_filename(abfd) ((abfd)->filename)
 #define bfd_get_cacheable(abfd) ((abfd)->cacheable)
 #define bfd_get_format(abfd) ((abfd)->format)
 #define bfd_get_target(abfd) ((abfd)->xvec->name)
@@ -1195,6 +1193,8 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section
 
 char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
 
+void bfd_set_filename (bfd *abfd, char *filename);
+
 /* Extracted from libbfd.c.  */
 
 /* Byte swapping macros for user section data.  */
@@ -2004,6 +2004,8 @@ bfd_boolean bfd_copy_private_section_data
                  (ibfd, isection, obfd, osection))
 bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
 
+const char *bfd_generic_group_name (bfd *, const asection *sec);
+
 bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
 
 /* Extracted from archures.c.  */
@@ -2516,6 +2518,16 @@ typedef struct bfd_arch_info
                  bfd_boolean code);
 
   const struct bfd_arch_info *next;
+
+  /* On some architectures the offset for a relocation can point into
+     the middle of an instruction.  This field specifies the maximum
+     offset such a relocation can have (in octets).  This affects the
+     behaviour of the disassembler, since a value greater than zero
+     means that it may need to disassemble an instruction twice, once
+     to get its length and then a second time to display it.  If the
+     value is negative then this has to be done for every single
+     instruction, regardless of the offset of the reloc.  */
+  signed int max_reloc_offset_into_insn;
 }
 bfd_arch_info_type;
 
@@ -2533,13 +2545,13 @@ void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
 bfd_boolean bfd_default_set_arch_mach
    (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
 
-enum bfd_architecture bfd_get_arch (bfd *abfd);
+enum bfd_architecture bfd_get_arch (const bfd *abfd);
 
-unsigned long bfd_get_mach (bfd *abfd);
+unsigned long bfd_get_mach (const bfd *abfd);
 
-unsigned int bfd_arch_bits_per_byte (bfd *abfd);
+unsigned int bfd_arch_bits_per_byte (const bfd *abfd);
 
-unsigned int bfd_arch_bits_per_address (bfd *abfd);
+unsigned int bfd_arch_bits_per_address (const bfd *abfd);
 
 const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
 
@@ -2549,7 +2561,7 @@ const bfd_arch_info_type *bfd_lookup_arch
 const char *bfd_printable_arch_mach
    (enum bfd_architecture arch, unsigned long machine);
 
-unsigned int bfd_octets_per_byte (bfd *abfd);
+unsigned int bfd_octets_per_byte (const bfd *abfd);
 
 unsigned int bfd_arch_mach_octets_per_byte
    (enum bfd_architecture arch, unsigned long machine);
@@ -2706,7 +2718,7 @@ struct reloc_howto_struct
      bfd *, char **);
 
   /* The textual name of the relocation type.  */
-  char *name;
+  const char *name;
 };
 
 #define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name,   \
@@ -7180,6 +7192,9 @@ struct bfd
   /* Set if this is a thin archive.  */
   unsigned int is_thin_archive : 1;
 
+  /* Set if this archive should not cache element positions.  */
+  unsigned int no_element_cache : 1;
+
   /* Set if only required symbols should be added in the link hash table for
      this object.  Used by VMS linkers.  */
   unsigned int selective_search : 1;
@@ -7197,7 +7212,7 @@ struct bfd
   unsigned int lto_output : 1;
 
   /* Set if this is a slim LTO object not loaded with a compiler plugin.  */
-  unsigned int lto_slim_object: 1;
+  unsigned int lto_slim_object : 1;
 
   /* Set to dummy BFD created when claimed by a compiler plug-in
      library.  */
@@ -7466,6 +7481,9 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
 #define bfd_is_group_section(abfd, sec) \
        BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
 
+#define bfd_group_name(abfd, sec) \
+       BFD_SEND (abfd, _bfd_group_name, (abfd, sec))
+
 #define bfd_discard_group(abfd, sec) \
        BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
 
@@ -7616,7 +7634,7 @@ typedef struct flag_info flag_info;
 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.  */
@@ -7897,6 +7915,7 @@ typedef struct bfd_target
   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, \
@@ -7955,6 +7974,9 @@ typedef struct bfd_target
   /* 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 *);
 
This page took 0.035087 seconds and 4 git commands to generate.