]> Git Repo - binutils.git/blobdiff - bfd/elf-bfd.h
bfd:
[binutils.git] / bfd / elf-bfd.h
index 3fa25136fd2d32aa992c666ec3ded9c0cc71767e..0a438ef3f163a32768d5c4fcb8edf1fe282fcb04 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end data structures for ELF files.
-   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 Free Software
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999, 2000 Free Software
    Foundation, Inc.
    Written by Cygnus Support.
 
@@ -157,7 +157,7 @@ struct elf_link_hash_entry
   /* Symbol type (STT_NOTYPE, STT_OBJECT, etc.).  */
   char type;
 
-  /* Symbol st_other value.  */
+  /* Symbol st_other value, symbol visibility.  */
   unsigned char other;
 
   /* Hash value of the name computed using the ELF hash function.  */
@@ -189,6 +189,9 @@ struct elf_link_hash_entry
 #define ELF_LINK_FORCED_LOCAL 02000
   /* Symbol was marked during garbage collection.  */
 #define ELF_LINK_HASH_MARK 04000
+  /* Symbol is referenced by a non-GOT/non-PLT relocation.  This is
+     not currently set by all the backends.  */
+#define ELF_LINK_NON_GOT_REF 010000
 };
 
 /* Records local symbols to be emitted in the dynamic symbol table.  */
@@ -240,6 +243,12 @@ struct elf_link_hash_table
   PTR stab_info;
   /* A linked list of local symbols to be added to .dynsym.  */
   struct elf_link_local_dynamic_entry *dynlocal;
+
+  void (*copy_indirect) PARAMS ((struct elf_link_hash_table *,
+                                struct elf_link_hash_entry *,
+                                struct elf_link_hash_entry *));
+  void (*hide_symbol) PARAMS ((struct elf_link_hash_table *,
+                              struct elf_link_hash_entry *));
 };
 
 /* Look up an entry in an ELF linker hash table.  */
@@ -260,6 +269,16 @@ struct elf_link_hash_table
 /* Get the ELF linker hash table from a link_info structure.  */
 
 #define elf_hash_table(p) ((struct elf_link_hash_table *) ((p)->hash))
+
+/* Call the copy_indirect method.  */
+
+#define elf_link_hash_copy_indirect(TABLE,DIR,IND) \
+  ((*(TABLE)->copy_indirect) ((TABLE), (DIR), (IND)))
+
+/* Call the hide_symbol method.  */
+
+#define elf_link_hash_hide_symbol(TABLE,SYM) \
+  ((*(TABLE)->hide_symbol) ((TABLE), (SYM)))
 \f
 /* Constant information held for an ELF backend.  */
 
@@ -329,18 +348,6 @@ struct elf_backend_data
   /* The maximum page size for this backend.  */
   bfd_vma maxpagesize;
 
-  /* This is true if the linker should act like collect and gather
-     global constructors and destructors by name.  This is true for
-     MIPS ELF because the Irix 5 tools can not handle the .init
-     section.  */
-  boolean collect;
-
-  /* This is true if the linker should ignore changes to the type of a
-     symbol.  This is true for MIPS ELF because some Irix 5 objects
-     record undefined functions as STT_OBJECT although the definitions
-     are STT_FUNC.  */
-  boolean type_change_ok;
-
   /* A function to translate an ELF RELA relocation to a BFD arelent
      structure.  */
   void (*elf_info_to_howto) PARAMS ((bfd *, arelent *,
@@ -397,6 +404,12 @@ struct elf_backend_data
                                                    Elf32_Internal_Shdr *,
                                                    char *));
 
+  /* A function to handle unusual program segment types when creating BFD
+     sections from ELF program segments. */
+  boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *,
+                                                   Elf32_Internal_Phdr *,
+                                                   int));
+
   /* A function to set up the ELF section header for a BFD section in
      preparation for writing it out.  This is where the flags and type
      fields are set for unusual sections.  */
@@ -615,6 +628,18 @@ struct elf_backend_data
   bfd_vma got_header_size;
   bfd_vma plt_header_size;
 
+  /* This is true if the linker should act like collect and gather
+     global constructors and destructors by name.  This is true for
+     MIPS ELF because the Irix 5 tools can not handle the .init
+     section.  */
+  unsigned collect : 1;
+
+  /* This is true if the linker should ignore changes to the type of a
+     symbol.  This is true for MIPS ELF because some Irix 5 objects
+     record undefined functions as STT_OBJECT although the definitions
+     are STT_FUNC.  */
+  unsigned type_change_ok : 1;
+
   /* Whether the backend may use REL relocations.  (Some backends use
      both REL and RELA relocations, and this flag is set for those
      backends.)  */
@@ -632,6 +657,10 @@ struct elf_backend_data
      section.  */   
   unsigned default_use_rela_p : 1;
 
+  /* True if addresses "naturally" sign extend.  This is used when
+     swapping in from Elf32 when BFD64.  */
+  unsigned sign_extend_vma : 1;
+
   unsigned want_got_plt : 1;
   unsigned plt_readonly : 1;
   unsigned want_plt_sym : 1;
@@ -938,6 +967,8 @@ extern boolean bfd_elf_mkcorefile PARAMS ((bfd *));
 extern Elf_Internal_Shdr *bfd_elf_find_section PARAMS ((bfd *, char *));
 extern boolean _bfd_elf_make_section_from_shdr
   PARAMS ((bfd *abfd, Elf_Internal_Shdr *hdr, const char *name));
+extern boolean _bfd_elf_make_section_from_phdr
+  PARAMS ((bfd *abfd, Elf_Internal_Phdr *hdr, int index, const char *typename));
 extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc
   PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
 extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
@@ -1273,4 +1304,8 @@ extern boolean _bfd_mips_elf_relocate_section
   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
           Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
 
+/* SH ELF specific routine.  */
+
+extern boolean _sh_elf_set_mach_from_flags PARAMS ((bfd *));
+
 #endif /* _LIBELF_H_ */
This page took 0.031003 seconds and 4 git commands to generate.