/* 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.
/* 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. */
#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. */
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. */
/* 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. */
/* 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 *,
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. */
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.) */
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;
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
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_ */