#ifndef _ELF32_M68HC1X_H
#define _ELF32_M68HC1X_H
#include "elf-bfd.h"
#include "bfdlink.h"
#include "elf/m68hc11.h"
#define BFD_M68HC11_BANK_START_NAME "__bank_start"
#define BFD_M68HC11_BANK_SIZE_NAME "__bank_size"
#define BFD_M68HC11_BANK_VIRTUAL_NAME "__bank_virtual"
extern bfd_boolean _bfd_m68hc11_elf_merge_private_bfd_data (bfd*,bfd*);
extern bfd_boolean _bfd_m68hc11_elf_set_private_flags (bfd*,flagword);
extern bfd_boolean _bfd_m68hc11_elf_print_private_bfd_data (bfd*, void*);
struct elf32_m68hc11_stub_hash_entry {
struct bfd_hash_entry root;
asection *stub_sec;
bfd_vma stub_offset;
bfd_vma target_value;
asection *target_section;
};
struct m68hc11_page_info
{
bfd_vma bank_virtual;
bfd_vma bank_physical;
bfd_vma bank_physical_end;
bfd_vma bank_mask;
bfd_vma bank_size;
int bank_shift;
int bank_param_initialized;
bfd_vma trampoline_addr;
};
struct m68hc11_elf_link_hash_table
{
struct elf_link_hash_table root;
struct m68hc11_page_info pinfo;
struct bfd_hash_table* stub_hash_table;
bfd *stub_bfd;
asection* stub_section;
asection* tramp_section;
asection * (*add_stub_section) PARAMS ((const char *, asection *));
unsigned int bfd_count;
int top_index;
asection **input_list;
struct sym_sec_cache sym_sec;
bfd_boolean (* size_one_stub) PARAMS((struct bfd_hash_entry*, void*));
bfd_boolean (* build_one_stub) PARAMS((struct bfd_hash_entry*, void*));
};
#define m68hc11_elf_hash_table(p) \
((struct m68hc11_elf_link_hash_table *) ((p)->hash))
extern struct m68hc11_elf_link_hash_table* m68hc11_elf_hash_table_create
(bfd*);
extern void m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table*);
extern void m68hc11_elf_get_bank_parameters (struct bfd_link_info*);
extern int m68hc11_addr_is_banked (struct m68hc11_page_info*, bfd_vma);
extern bfd_vma m68hc11_phys_addr (struct m68hc11_page_info*, bfd_vma);
extern bfd_vma m68hc11_phys_page (struct m68hc11_page_info*, bfd_vma);
bfd_reloc_status_type m68hc11_elf_ignore_reloc
(bfd *abfd, arelent *reloc_entry,
asymbol *symbol, void *data, asection *input_section,
bfd *output_bfd, char **error_message);
bfd_reloc_status_type m68hc11_elf_special_reloc
(bfd *abfd, arelent *reloc_entry,
asymbol *symbol, void *data, asection *input_section,
bfd *output_bfd, char **error_message);
asection *elf32_m68hc11_gc_mark_hook
(asection *sec, struct bfd_link_info *info,
Elf_Internal_Rela *rel, struct elf_link_hash_entry *h,
Elf_Internal_Sym *sym);
bfd_boolean elf32_m68hc11_gc_sweep_hook
(bfd *abfd, struct bfd_link_info *info,
asection *sec, const Elf_Internal_Rela *relocs);
bfd_boolean elf32_m68hc11_check_relocs
(bfd * abfd, struct bfd_link_info * info,
asection * sec, const Elf_Internal_Rela * relocs);
bfd_boolean elf32_m68hc11_relocate_section
(bfd *output_bfd, struct bfd_link_info *info,
bfd *input_bfd, asection *input_section,
bfd_byte *contents, Elf_Internal_Rela *relocs,
Elf_Internal_Sym *local_syms, asection **local_sections);
bfd_boolean elf32_m68hc11_add_symbol_hook
(bfd *abfd, struct bfd_link_info *info,
const Elf_Internal_Sym *sym, const char **namep,
flagword *flagsp, asection **secp,
bfd_vma *valp);
extern void elf32_m68hc11_post_process_headers (bfd*, struct bfd_link_info*);
int elf32_m68hc11_setup_section_lists (bfd *, struct bfd_link_info *);
bfd_boolean elf32_m68hc11_size_stubs
(bfd *, bfd *, struct bfd_link_info *,
asection * (*) (const char *, asection *));
bfd_boolean elf32_m68hc11_build_stubs (bfd* abfd, struct bfd_link_info *);
#endif