#define ELF_LINK_HASH_DEF_DYNAMIC 010
/* Dynamic symbol has been adjustd. */
#define ELF_LINK_HASH_DYNAMIC_ADJUSTED 020
- /* Symbol is defined as weak. */
-#define ELF_LINK_HASH_DEFINED_WEAK 040
/* Symbol needs a copy reloc. */
-#define ELF_LINK_HASH_NEEDS_COPY 0100
+#define ELF_LINK_HASH_NEEDS_COPY 040
+ /* Symbol needs a procedure linkage table entry. */
+#define ELF_LINK_HASH_NEEDS_PLT 0100
};
/* ELF linker hash table. */
struct elf_link_hash_table
{
struct bfd_link_hash_table root;
- /* The first dynamic object found during a link. We create several
- special input sections when linking against dynamic objects, and
- we simply attach them to the first one found. */
+ /* Whether we have created the special dynamic sections required
+ when linking against or generating a shared object. */
+ boolean dynamic_sections_created;
+ /* The BFD used to hold special sections created by the linker.
+ This will be the first BFD found which requires these sections to
+ be created. */
bfd *dynobj;
/* The number of symbols found in the link which must be put into
the .dynsym section. */
/* The number of buckets in the hash table in the .hash section.
This is based on the number of dynamic symbols. */
size_t bucketcount;
+ /* Whether we are linking against a dynamic object which has a
+ DT_NEEDED entry in the .dynamic section. This may need to become
+ a list of DT_NEEDED entries. */
+ boolean saw_needed;
};
/* Look up an entry in an ELF linker hash table. */
referenced by a regular object. This is called after all the
input files have been seen, but before the SIZE_DYNAMIC_SECTIONS
function has been called. The hash table entry should be
- bfd_link_hash_defined, and it should be defined in a section from
- a dynamic object. Dynamic object sections are not included in
- the final link, and this function is responsible for changing the
- value to something which the rest of the link can deal with.
- This will normally involve adding an entry to the .plt or .got or
- some such section, and setting the symbol to point to that. */
+ bfd_link_hash_defined ore bfd_link_hash_defweak, and it should be
+ defined in a section from a dynamic object. Dynamic object
+ sections are not included in the final link, and this function is
+ responsible for changing the value to something which the rest of
+ the link can deal with. This will normally involve adding an
+ entry to the .plt or .got or some such section, and setting the
+ symbol to point to that. */
boolean (*elf_backend_adjust_dynamic_symbol)
PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h));
/* The swapping table to use when dealing with ECOFF information.
Used for the MIPS ELF .mdebug section. */
const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap;
+
+ /* Alternate EM_xxxx machine codes for this backend. */
+ int elf_machine_alt1;
+ int elf_machine_alt2;
};
/* Information stored for each BFD section in an ELF file. This
rather than RELA, all the r_addend fields will be zero. This
pointer may be NULL. It is used by the backend linker. */
Elf_Internal_Rela *relocs;
+ /* Used by the backend linker when generating a shared library to
+ record the dynamic symbol index for a section symbol
+ corresponding to this section. */
+ long dynindx;
};
#define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd)
sh_info field in the symbol table header, and always read all the
symbols. */
boolean bad_symtab;
+
+ /* Records the result of `get_program_header_size'. */
+ bfd_size_type program_header_size;
+
+ /* Used by MIPS ELF find_nearest_line entry point. The structure
+ could be included directly in this one, but there's no point to
+ wasting the memory just for the infrequently called
+ find_nearest_line. */
+ struct mips_elf_find_line *find_line_info;
+
+ /* Used by PowerPC to determine if the e_flags field has been intiialized */
+ boolean ppc_flags_init;
};
#define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data)
#define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got_offsets)
#define elf_dt_needed_name(bfd) (elf_tdata(bfd) -> dt_needed_name)
#define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab)
+#define elf_ppc_flags_init(bfd) (elf_tdata(bfd) -> ppc_flags_init)
\f
extern char * elf_string_from_elf_section PARAMS ((bfd *, unsigned, unsigned));
extern char * elf_get_str_section PARAMS ((bfd *, unsigned));
CONST char **,
unsigned int *));
extern int bfd_elf32_sizeof_headers PARAMS ((bfd *, boolean));
-extern void bfd_elf32__write_relocs PARAMS ((bfd *, asection *, PTR));
extern boolean bfd_elf32_new_section_hook PARAMS ((bfd *, asection *));
extern boolean bfd_elf32_bfd_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));
CONST char **,
unsigned int *));
extern int bfd_elf64_sizeof_headers PARAMS ((bfd *, boolean));
-extern void bfd_elf64__write_relocs PARAMS ((bfd *, asection *, PTR));
extern boolean bfd_elf64_new_section_hook PARAMS ((bfd *, asection *));
extern boolean bfd_elf64_bfd_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));