* elf32-m68hc1x.c: Update to ISO C90; replace PTR with void*.

* elf32-m68hc11.c: Likewise.
	* elf32-m68hc12.c: Likewise.
	* elf32-m68hc1x.h: Likewise.
This commit is contained in:
Stephane Carrez
2003-10-04 21:02:53 +00:00
parent 17e58af002
commit 0a6a3ebe97
5 changed files with 167 additions and 251 deletions

View File

@ -1,3 +1,10 @@
2003-10-04 Stephane Carrez <stcarrez@nerim.fr>
* elf32-m68hc1x.c: Update to ISO C90; replace PTR with void*.
* elf32-m68hc11.c: Likewise.
* elf32-m68hc12.c: Likewise.
* elf32-m68hc1x.h: Likewise.
2003-10-04 Stephane Carrez <stcarrez@nerim.fr> 2003-10-04 Stephane Carrez <stcarrez@nerim.fr>
* elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Fix merge * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Fix merge

View File

@ -30,27 +30,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Relocation functions. */ /* Relocation functions. */
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); (bfd *, bfd_reloc_code_real_type);
static void m68hc11_info_to_howto_rel static void m68hc11_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); (bfd *, arelent *, Elf_Internal_Rela *);
/* Trampoline generation. */ /* Trampoline generation. */
static bfd_boolean m68hc11_elf_size_one_stub static bfd_boolean m68hc11_elf_size_one_stub
PARAMS((struct bfd_hash_entry *gen_entry, PTR in_arg)); (struct bfd_hash_entry *gen_entry, void *in_arg);
static bfd_boolean m68hc11_elf_build_one_stub static bfd_boolean m68hc11_elf_build_one_stub
PARAMS((struct bfd_hash_entry *gen_entry, PTR in_arg)); (struct bfd_hash_entry *gen_entry, void *in_arg);
static struct bfd_link_hash_table* m68hc11_elf_bfd_link_hash_table_create static struct bfd_link_hash_table* m68hc11_elf_bfd_link_hash_table_create
PARAMS ((bfd* abfd)); (bfd* abfd);
/* Linker relaxation. */ /* Linker relaxation. */
static bfd_boolean m68hc11_elf_relax_section static bfd_boolean m68hc11_elf_relax_section
PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *)); (bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
static void m68hc11_elf_relax_delete_bytes static void m68hc11_elf_relax_delete_bytes
PARAMS ((bfd *, asection *, bfd_vma, int)); (bfd *, asection *, bfd_vma, int);
static void m68hc11_relax_group static void m68hc11_relax_group
PARAMS ((bfd *, asection *, bfd_byte *, unsigned, (bfd *, asection *, bfd_byte *, unsigned, unsigned long, unsigned long);
unsigned long, unsigned long)); static int compare_reloc (const void *, const void *);
static int compare_reloc PARAMS ((const void *, const void *));
/* Use REL instead of RELA to save space */ /* Use REL instead of RELA to save space */
#define USE_REL 1 #define USE_REL 1
@ -342,9 +341,8 @@ static const struct m68hc11_reloc_map m68hc11_reloc_map[] = {
}; };
static reloc_howto_type * static reloc_howto_type *
bfd_elf32_bfd_reloc_type_lookup (abfd, code) bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code)
bfd_reloc_code_real_type code;
{ {
unsigned int i; unsigned int i;
@ -362,10 +360,8 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
/* Set the howto pointer for an M68HC11 ELF reloc. */ /* Set the howto pointer for an M68HC11 ELF reloc. */
static void static void
m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr, Elf_Internal_Rela *dst)
arelent *cache_ptr;
Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;
@ -379,9 +375,7 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst)
/* Build a 68HC11 trampoline stub. */ /* Build a 68HC11 trampoline stub. */
static bfd_boolean static bfd_boolean
m68hc11_elf_build_one_stub (gen_entry, in_arg) m68hc11_elf_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
struct bfd_hash_entry *gen_entry;
PTR in_arg;
{ {
struct elf32_m68hc11_stub_hash_entry *stub_entry; struct elf32_m68hc11_stub_hash_entry *stub_entry;
struct bfd_link_info *info; struct bfd_link_info *info;
@ -443,9 +437,8 @@ m68hc11_elf_build_one_stub (gen_entry, in_arg)
we know stub section sizes. */ we know stub section sizes. */
static bfd_boolean static bfd_boolean
m68hc11_elf_size_one_stub (gen_entry, in_arg) m68hc11_elf_size_one_stub (struct bfd_hash_entry *gen_entry,
struct bfd_hash_entry *gen_entry; void *in_arg ATTRIBUTE_UNUSED)
PTR in_arg ATTRIBUTE_UNUSED;
{ {
struct elf32_m68hc11_stub_hash_entry *stub_entry; struct elf32_m68hc11_stub_hash_entry *stub_entry;
@ -459,8 +452,7 @@ m68hc11_elf_size_one_stub (gen_entry, in_arg)
/* Create a 68HC11 ELF linker hash table. */ /* Create a 68HC11 ELF linker hash table. */
static struct bfd_link_hash_table * static struct bfd_link_hash_table *
m68hc11_elf_bfd_link_hash_table_create (abfd) m68hc11_elf_bfd_link_hash_table_create (bfd *abfd)
bfd *abfd;
{ {
struct m68hc11_elf_link_hash_table *ret; struct m68hc11_elf_link_hash_table *ret;
@ -533,9 +525,7 @@ find_relaxable_insn (unsigned char code)
} }
static int static int
compare_reloc (e1, e2) compare_reloc (const void *e1, const void *e2)
const void *e1;
const void *e2;
{ {
const Elf_Internal_Rela *i1 = (const Elf_Internal_Rela *) e1; const Elf_Internal_Rela *i1 = (const Elf_Internal_Rela *) e1;
const Elf_Internal_Rela *i2 = (const Elf_Internal_Rela *) e2; const Elf_Internal_Rela *i2 = (const Elf_Internal_Rela *) e2;
@ -549,13 +539,9 @@ compare_reloc (e1, e2)
#define M6811_OP_LDX_IMMEDIATE (0xCE) #define M6811_OP_LDX_IMMEDIATE (0xCE)
static void static void
m68hc11_relax_group (abfd, sec, contents, value, offset, end_group) m68hc11_relax_group (bfd *abfd, asection *sec, bfd_byte *contents,
bfd *abfd; unsigned value, unsigned long offset,
asection *sec; unsigned long end_group)
bfd_byte *contents;
unsigned value;
unsigned long offset;
unsigned long end_group;
{ {
unsigned char code; unsigned char code;
unsigned long start_offset; unsigned long start_offset;
@ -665,11 +651,8 @@ m68hc11_relax_group (abfd, sec, contents, value, offset, end_group)
and somewhat more difficult to support. */ and somewhat more difficult to support. */
static bfd_boolean static bfd_boolean
m68hc11_elf_relax_section (abfd, sec, link_info, again) m68hc11_elf_relax_section (bfd *abfd, asection *sec,
bfd *abfd; struct bfd_link_info *link_info, bfd_boolean *again)
asection *sec;
struct bfd_link_info *link_info;
bfd_boolean *again;
{ {
Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Shdr *shndx_hdr; Elf_Internal_Shdr *shndx_hdr;
@ -1121,11 +1104,8 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
/* Delete some bytes from a section while relaxing. */ /* Delete some bytes from a section while relaxing. */
static void static void
m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count) m68hc11_elf_relax_delete_bytes (bfd *abfd, asection *sec,
bfd *abfd; bfd_vma addr, int count)
asection *sec;
bfd_vma addr;
int count;
{ {
Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Shdr *symtab_hdr;
unsigned int sec_shndx; unsigned int sec_shndx;

View File

@ -30,17 +30,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Relocation functions. */ /* Relocation functions. */
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); (bfd *, bfd_reloc_code_real_type);
static void m68hc11_info_to_howto_rel static void m68hc11_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); (bfd *, arelent *, Elf_Internal_Rela *);
/* Trampoline generation. */ /* Trampoline generation. */
static bfd_boolean m68hc12_elf_size_one_stub static bfd_boolean m68hc12_elf_size_one_stub
PARAMS((struct bfd_hash_entry *gen_entry, PTR in_arg)); (struct bfd_hash_entry *gen_entry, void *in_arg);
static bfd_boolean m68hc12_elf_build_one_stub static bfd_boolean m68hc12_elf_build_one_stub
PARAMS((struct bfd_hash_entry *gen_entry, PTR in_arg)); (struct bfd_hash_entry *gen_entry, void *in_arg);
static struct bfd_link_hash_table* m68hc12_elf_bfd_link_hash_table_create static struct bfd_link_hash_table* m68hc12_elf_bfd_link_hash_table_create
PARAMS((bfd*)); (bfd*);
static bfd_boolean m68hc12_elf_set_mach_from_flags PARAMS ((bfd *)); static bfd_boolean m68hc12_elf_set_mach_from_flags PARAMS ((bfd *));
@ -390,9 +390,8 @@ static const struct m68hc11_reloc_map m68hc11_reloc_map[] = {
}; };
static reloc_howto_type * static reloc_howto_type *
bfd_elf32_bfd_reloc_type_lookup (abfd, code) bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code)
bfd_reloc_code_real_type code;
{ {
unsigned int i; unsigned int i;
@ -410,10 +409,8 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
/* Set the howto pointer for an M68HC11 ELF reloc. */ /* Set the howto pointer for an M68HC11 ELF reloc. */
static void static void
m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr, Elf_Internal_Rela *dst)
arelent *cache_ptr;
Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;
@ -427,9 +424,7 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst)
/* Build a 68HC12 trampoline stub. */ /* Build a 68HC12 trampoline stub. */
static bfd_boolean static bfd_boolean
m68hc12_elf_build_one_stub (gen_entry, in_arg) m68hc12_elf_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
struct bfd_hash_entry *gen_entry;
PTR in_arg;
{ {
struct elf32_m68hc11_stub_hash_entry *stub_entry; struct elf32_m68hc11_stub_hash_entry *stub_entry;
struct bfd_link_info *info; struct bfd_link_info *info;
@ -483,9 +478,8 @@ m68hc12_elf_build_one_stub (gen_entry, in_arg)
we know stub section sizes. */ we know stub section sizes. */
static bfd_boolean static bfd_boolean
m68hc12_elf_size_one_stub (gen_entry, in_arg) m68hc12_elf_size_one_stub (struct bfd_hash_entry *gen_entry,
struct bfd_hash_entry *gen_entry; void *in_arg ATTRIBUTE_UNUSED)
PTR in_arg ATTRIBUTE_UNUSED;
{ {
struct elf32_m68hc11_stub_hash_entry *stub_entry; struct elf32_m68hc11_stub_hash_entry *stub_entry;
@ -499,8 +493,7 @@ m68hc12_elf_size_one_stub (gen_entry, in_arg)
/* Create a 68HC12 ELF linker hash table. */ /* Create a 68HC12 ELF linker hash table. */
static struct bfd_link_hash_table * static struct bfd_link_hash_table *
m68hc12_elf_bfd_link_hash_table_create (abfd) m68hc12_elf_bfd_link_hash_table_create (bfd *abfd)
bfd *abfd;
{ {
struct m68hc11_elf_link_hash_table *ret; struct m68hc11_elf_link_hash_table *ret;
@ -515,8 +508,7 @@ m68hc12_elf_bfd_link_hash_table_create (abfd)
} }
static bfd_boolean static bfd_boolean
m68hc12_elf_set_mach_from_flags (abfd) m68hc12_elf_set_mach_from_flags (bfd *abfd)
bfd *abfd;
{ {
flagword flags = elf_elfheader (abfd)->e_flags; flagword flags = elf_elfheader (abfd)->e_flags;

View File

@ -33,31 +33,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
bfd_hash_lookup ((table), (string), (create), (copy))) bfd_hash_lookup ((table), (string), (create), (copy)))
static struct elf32_m68hc11_stub_hash_entry* m68hc12_add_stub static struct elf32_m68hc11_stub_hash_entry* m68hc12_add_stub
PARAMS((const char *stub_name, (const char *stub_name,
asection *section, asection *section,
struct m68hc11_elf_link_hash_table *htab)); struct m68hc11_elf_link_hash_table *htab);
static struct bfd_hash_entry *stub_hash_newfunc static struct bfd_hash_entry *stub_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
static void m68hc11_elf_set_symbol static void m68hc11_elf_set_symbol (bfd* abfd, struct bfd_link_info *info,
PARAMS ((bfd* abfd, struct bfd_link_info *info, const char* name, bfd_vma value,
const char* name, bfd_vma value, asection* sec)); asection* sec);
static bfd_boolean m68hc11_elf_export_one_stub static bfd_boolean m68hc11_elf_export_one_stub
PARAMS((struct bfd_hash_entry *gen_entry, PTR in_arg)); (struct bfd_hash_entry *gen_entry, void *in_arg);
static bfd_boolean m68hc11_get_relocation_value static bfd_boolean m68hc11_get_relocation_value
PARAMS ((bfd* abfd, (bfd* abfd,
struct bfd_link_info* info, struct bfd_link_info* info,
asection **local_sections, asection **local_sections,
Elf_Internal_Sym* local_syms, Elf_Internal_Sym* local_syms,
Elf_Internal_Rela* rel, Elf_Internal_Rela* rel,
const char** name, const char** name,
bfd_vma* relocation, bfd_vma* relocation,
bfd_boolean* is_far)); bfd_boolean* is_far);
static void scan_sections_for_abi PARAMS ((bfd*, asection*, PTR)); static void scan_sections_for_abi (bfd*, asection*, PTR);
struct m68hc11_scan_param struct m68hc11_scan_param
{ {
@ -69,8 +69,7 @@ struct m68hc11_scan_param
/* Create a 68HC11/68HC12 ELF linker hash table. */ /* Create a 68HC11/68HC12 ELF linker hash table. */
struct m68hc11_elf_link_hash_table* struct m68hc11_elf_link_hash_table*
m68hc11_elf_hash_table_create (abfd) m68hc11_elf_hash_table_create (bfd *abfd)
bfd *abfd;
{ {
struct m68hc11_elf_link_hash_table *ret; struct m68hc11_elf_link_hash_table *ret;
bfd_size_type amt = sizeof (struct m68hc11_elf_link_hash_table); bfd_size_type amt = sizeof (struct m68hc11_elf_link_hash_table);
@ -109,8 +108,7 @@ m68hc11_elf_hash_table_create (abfd)
/* Free the derived linker hash table. */ /* Free the derived linker hash table. */
void void
m68hc11_elf_bfd_link_hash_table_free (hash) m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *hash)
struct bfd_link_hash_table *hash;
{ {
struct m68hc11_elf_link_hash_table *ret struct m68hc11_elf_link_hash_table *ret
= (struct m68hc11_elf_link_hash_table *) hash; = (struct m68hc11_elf_link_hash_table *) hash;
@ -125,10 +123,8 @@ m68hc11_elf_bfd_link_hash_table_free (hash)
/* Initialize an entry in the stub hash table. */ /* Initialize an entry in the stub hash table. */
static struct bfd_hash_entry * static struct bfd_hash_entry *
stub_hash_newfunc (entry, table, string) stub_hash_newfunc (struct bfd_hash_entry *entry, struct bfd_hash_table *table,
struct bfd_hash_entry *entry; const char *string)
struct bfd_hash_table *table;
const char *string;
{ {
/* Allocate the structure if it has not already been allocated by a /* Allocate the structure if it has not already been allocated by a
subclass. */ subclass. */
@ -161,10 +157,8 @@ stub_hash_newfunc (entry, table, string)
stub entry are initialised. */ stub entry are initialised. */
static struct elf32_m68hc11_stub_hash_entry * static struct elf32_m68hc11_stub_hash_entry *
m68hc12_add_stub (stub_name, section, htab) m68hc12_add_stub (const char *stub_name, asection *section,
const char *stub_name; struct m68hc11_elf_link_hash_table *htab)
asection *section;
struct m68hc11_elf_link_hash_table *htab;
{ {
struct elf32_m68hc11_stub_hash_entry *stub_entry; struct elf32_m68hc11_stub_hash_entry *stub_entry;
@ -195,14 +189,12 @@ m68hc12_add_stub (stub_name, section, htab)
the trampoline handler. */ the trampoline handler. */
bfd_boolean bfd_boolean
elf32_m68hc11_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) elf32_m68hc11_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
bfd *abfd; const Elf_Internal_Sym *sym,
struct bfd_link_info *info; const char **namep ATTRIBUTE_UNUSED,
const Elf_Internal_Sym *sym; flagword *flagsp ATTRIBUTE_UNUSED,
const char **namep ATTRIBUTE_UNUSED; asection **secp ATTRIBUTE_UNUSED,
flagword *flagsp ATTRIBUTE_UNUSED; bfd_vma *valp ATTRIBUTE_UNUSED)
asection **secp ATTRIBUTE_UNUSED;
bfd_vma *valp ATTRIBUTE_UNUSED;
{ {
if (sym->st_other & STO_M68HC12_FAR) if (sym->st_other & STO_M68HC12_FAR)
{ {
@ -234,9 +226,7 @@ elf32_m68hc11_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
0 when no stubs will be needed, and 1 on success. */ 0 when no stubs will be needed, and 1 on success. */
int int
elf32_m68hc11_setup_section_lists (output_bfd, info) elf32_m68hc11_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
bfd *output_bfd;
struct bfd_link_info *info;
{ {
bfd *input_bfd; bfd *input_bfd;
unsigned int bfd_count; unsigned int bfd_count;
@ -326,11 +316,9 @@ elf32_m68hc11_setup_section_lists (output_bfd, info)
instruction. */ instruction. */
bfd_boolean bfd_boolean
elf32_m68hc11_size_stubs (output_bfd, stub_bfd, info, add_stub_section) elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd,
bfd *output_bfd; struct bfd_link_info *info,
bfd *stub_bfd; asection * (*add_stub_section) (const char*, asection*))
struct bfd_link_info *info;
asection * (*add_stub_section) PARAMS ((const char *, asection *));
{ {
bfd *input_bfd; bfd *input_bfd;
asection *section; asection *section;
@ -571,9 +559,7 @@ elf32_m68hc11_size_stubs (output_bfd, stub_bfd, info, add_stub_section)
/* Export the trampoline addresses in the symbol table. */ /* Export the trampoline addresses in the symbol table. */
static bfd_boolean static bfd_boolean
m68hc11_elf_export_one_stub (gen_entry, in_arg) m68hc11_elf_export_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
struct bfd_hash_entry *gen_entry;
PTR in_arg;
{ {
struct bfd_link_info *info; struct bfd_link_info *info;
struct m68hc11_elf_link_hash_table *htab; struct m68hc11_elf_link_hash_table *htab;
@ -603,12 +589,8 @@ m68hc11_elf_export_one_stub (gen_entry, in_arg)
/* Export a symbol or set its value and section. */ /* Export a symbol or set its value and section. */
static void static void
m68hc11_elf_set_symbol (abfd, info, name, value, sec) m68hc11_elf_set_symbol (bfd *abfd, struct bfd_link_info *info,
bfd* abfd; const char *name, bfd_vma value, asection *sec)
struct bfd_link_info *info;
const char* name;
bfd_vma value;
asection* sec;
{ {
struct elf_link_hash_entry *h; struct elf_link_hash_entry *h;
@ -639,9 +621,7 @@ m68hc11_elf_set_symbol (abfd, info, name, value, sec)
linker. */ linker. */
bfd_boolean bfd_boolean
elf32_m68hc11_build_stubs (abfd, info) elf32_m68hc11_build_stubs (bfd *abfd, struct bfd_link_info *info)
bfd* abfd;
struct bfd_link_info *info;
{ {
asection *stub_sec; asection *stub_sec;
struct bfd_hash_table *table; struct bfd_hash_table *table;
@ -694,8 +674,7 @@ elf32_m68hc11_build_stubs (abfd, info)
} }
void void
m68hc11_elf_get_bank_parameters (info) m68hc11_elf_get_bank_parameters (struct bfd_link_info *info)
struct bfd_link_info *info;
{ {
unsigned i; unsigned i;
struct m68hc11_page_info *pinfo; struct m68hc11_page_info *pinfo;
@ -755,9 +734,7 @@ m68hc11_elf_get_bank_parameters (info)
/* Return 1 if the address is in banked memory. /* Return 1 if the address is in banked memory.
This can be applied to a virtual address and to a physical address. */ This can be applied to a virtual address and to a physical address. */
int int
m68hc11_addr_is_banked (pinfo, addr) m68hc11_addr_is_banked (struct m68hc11_page_info *pinfo, bfd_vma addr)
struct m68hc11_page_info *pinfo;
bfd_vma addr;
{ {
if (addr >= pinfo->bank_virtual) if (addr >= pinfo->bank_virtual)
return 1; return 1;
@ -771,9 +748,7 @@ m68hc11_addr_is_banked (pinfo, addr)
/* Return the physical address seen by the processor, taking /* Return the physical address seen by the processor, taking
into account banked memory. */ into account banked memory. */
bfd_vma bfd_vma
m68hc11_phys_addr (pinfo, addr) m68hc11_phys_addr (struct m68hc11_page_info *pinfo, bfd_vma addr)
struct m68hc11_page_info *pinfo;
bfd_vma addr;
{ {
if (addr < pinfo->bank_virtual) if (addr < pinfo->bank_virtual)
return addr; return addr;
@ -787,9 +762,7 @@ m68hc11_phys_addr (pinfo, addr)
/* Return the page number corresponding to an address in banked memory. */ /* Return the page number corresponding to an address in banked memory. */
bfd_vma bfd_vma
m68hc11_phys_page (pinfo, addr) m68hc11_phys_page (struct m68hc11_page_info *pinfo, bfd_vma addr)
struct m68hc11_page_info *pinfo;
bfd_vma addr;
{ {
if (addr < pinfo->bank_virtual) if (addr < pinfo->bank_virtual)
return 0; return 0;
@ -805,15 +778,13 @@ m68hc11_phys_page (pinfo, addr)
which the linker should otherwise ignore. */ which the linker should otherwise ignore. */
bfd_reloc_status_type bfd_reloc_status_type
m68hc11_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section, m68hc11_elf_ignore_reloc (bfd *abfd ATTRIBUTE_UNUSED,
output_bfd, error_message) arelent *reloc_entry,
bfd *abfd ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED,
arelent *reloc_entry; void *data ATTRIBUTE_UNUSED,
asymbol *symbol ATTRIBUTE_UNUSED; asection *input_section,
PTR data ATTRIBUTE_UNUSED; bfd *output_bfd,
asection *input_section; char **error_message ATTRIBUTE_UNUSED)
bfd *output_bfd;
char **error_message ATTRIBUTE_UNUSED;
{ {
if (output_bfd != NULL) if (output_bfd != NULL)
reloc_entry->address += input_section->output_offset; reloc_entry->address += input_section->output_offset;
@ -821,15 +792,13 @@ m68hc11_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section,
} }
bfd_reloc_status_type bfd_reloc_status_type
m68hc11_elf_special_reloc (abfd, reloc_entry, symbol, data, input_section, m68hc11_elf_special_reloc (bfd *abfd ATTRIBUTE_UNUSED,
output_bfd, error_message) arelent *reloc_entry,
bfd *abfd ATTRIBUTE_UNUSED; asymbol *symbol,
arelent *reloc_entry; void *data ATTRIBUTE_UNUSED,
asymbol *symbol; asection *input_section,
PTR data ATTRIBUTE_UNUSED; bfd *output_bfd,
asection *input_section; char **error_message ATTRIBUTE_UNUSED)
bfd *output_bfd;
char **error_message ATTRIBUTE_UNUSED;
{ {
if (output_bfd != (bfd *) NULL if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_SECTION_SYM) == 0
@ -850,12 +819,11 @@ m68hc11_elf_special_reloc (abfd, reloc_entry, symbol, data, input_section,
} }
asection * asection *
elf32_m68hc11_gc_mark_hook (sec, info, rel, h, sym) elf32_m68hc11_gc_mark_hook (asection *sec,
asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED,
struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel,
Elf_Internal_Rela *rel; struct elf_link_hash_entry *h,
struct elf_link_hash_entry *h; Elf_Internal_Sym *sym)
Elf_Internal_Sym *sym;
{ {
if (h != NULL) if (h != NULL)
{ {
@ -883,11 +851,10 @@ elf32_m68hc11_gc_mark_hook (sec, info, rel, h, sym)
} }
bfd_boolean bfd_boolean
elf32_m68hc11_gc_sweep_hook (abfd, info, sec, relocs) elf32_m68hc11_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *info ATTRIBUTE_UNUSED,
struct bfd_link_info *info ATTRIBUTE_UNUSED; asection *sec ATTRIBUTE_UNUSED,
asection *sec ATTRIBUTE_UNUSED; const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED)
const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
{ {
/* We don't use got and plt entries for 68hc11/68hc12. */ /* We don't use got and plt entries for 68hc11/68hc12. */
return TRUE; return TRUE;
@ -898,11 +865,8 @@ elf32_m68hc11_gc_sweep_hook (abfd, info, sec, relocs)
virtual table relocs for gc. */ virtual table relocs for gc. */
bfd_boolean bfd_boolean
elf32_m68hc11_check_relocs (abfd, info, sec, relocs) elf32_m68hc11_check_relocs (bfd *abfd, struct bfd_link_info *info,
bfd * abfd; asection *sec, const Elf_Internal_Rela *relocs)
struct bfd_link_info * info;
asection * sec;
const Elf_Internal_Rela * relocs;
{ {
Elf_Internal_Shdr * symtab_hdr; Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes; struct elf_link_hash_entry ** sym_hashes;
@ -955,17 +919,12 @@ elf32_m68hc11_check_relocs (abfd, info, sec, relocs)
} }
static bfd_boolean static bfd_boolean
m68hc11_get_relocation_value (abfd, info, local_sections, local_syms, m68hc11_get_relocation_value (bfd *abfd, struct bfd_link_info *info,
rel, name, asection **local_sections,
relocation, is_far) Elf_Internal_Sym *local_syms,
bfd *abfd; Elf_Internal_Rela *rel,
struct bfd_link_info *info; const char **name,
asection **local_sections; bfd_vma *relocation, bfd_boolean *is_far)
Elf_Internal_Sym* local_syms;
Elf_Internal_Rela* rel;
const char** name;
bfd_vma* relocation;
bfd_boolean* is_far;
{ {
Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **sym_hashes;
@ -1056,16 +1015,12 @@ m68hc11_get_relocation_value (abfd, info, local_sections, local_syms,
/* Relocate a 68hc11/68hc12 ELF section. */ /* Relocate a 68hc11/68hc12 ELF section. */
bfd_boolean bfd_boolean
elf32_m68hc11_relocate_section (output_bfd, info, input_bfd, input_section, elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
contents, relocs, local_syms, local_sections) struct bfd_link_info *info,
bfd *output_bfd ATTRIBUTE_UNUSED; bfd *input_bfd, asection *input_section,
struct bfd_link_info *info; bfd_byte *contents, Elf_Internal_Rela *relocs,
bfd *input_bfd; Elf_Internal_Sym *local_syms,
asection *input_section; asection **local_sections)
bfd_byte *contents;
Elf_Internal_Rela *relocs;
Elf_Internal_Sym *local_syms;
asection **local_sections;
{ {
Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **sym_hashes;
@ -1289,9 +1244,7 @@ elf32_m68hc11_relocate_section (output_bfd, info, input_bfd, input_section,
/* Set and control ELF flags in ELF header. */ /* Set and control ELF flags in ELF header. */
bfd_boolean bfd_boolean
_bfd_m68hc11_elf_set_private_flags (abfd, flags) _bfd_m68hc11_elf_set_private_flags (bfd *abfd, flagword flags)
bfd *abfd;
flagword flags;
{ {
BFD_ASSERT (!elf_flags_init (abfd) BFD_ASSERT (!elf_flags_init (abfd)
|| elf_elfheader (abfd)->e_flags == flags); || elf_elfheader (abfd)->e_flags == flags);
@ -1305,9 +1258,7 @@ _bfd_m68hc11_elf_set_private_flags (abfd, flags)
object file when linking. */ object file when linking. */
bfd_boolean bfd_boolean
_bfd_m68hc11_elf_merge_private_bfd_data (ibfd, obfd) _bfd_m68hc11_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
bfd *ibfd;
bfd *obfd;
{ {
flagword old_flags; flagword old_flags;
flagword new_flags; flagword new_flags;
@ -1398,9 +1349,7 @@ _bfd_m68hc11_elf_merge_private_bfd_data (ibfd, obfd)
} }
bfd_boolean bfd_boolean
_bfd_m68hc11_elf_print_private_bfd_data (abfd, ptr) _bfd_m68hc11_elf_print_private_bfd_data (bfd *abfd, void *ptr)
bfd *abfd;
PTR ptr;
{ {
FILE *file = (FILE *) ptr; FILE *file = (FILE *) ptr;
@ -1439,10 +1388,8 @@ _bfd_m68hc11_elf_print_private_bfd_data (abfd, ptr)
return TRUE; return TRUE;
} }
static void scan_sections_for_abi (abfd, asect, arg) static void scan_sections_for_abi (bfd *abfd ATTRIBUTE_UNUSED,
bfd* abfd ATTRIBUTE_UNUSED; asection *asect, void *arg)
asection* asect;
PTR arg;
{ {
struct m68hc11_scan_param* p = (struct m68hc11_scan_param*) arg; struct m68hc11_scan_param* p = (struct m68hc11_scan_param*) arg;
@ -1453,9 +1400,7 @@ static void scan_sections_for_abi (abfd, asect, arg)
/* Tweak the OSABI field of the elf header. */ /* Tweak the OSABI field of the elf header. */
void void
elf32_m68hc11_post_process_headers (abfd, link_info) elf32_m68hc11_post_process_headers (bfd *abfd, struct bfd_link_info *link_info)
bfd *abfd;
struct bfd_link_info *link_info;
{ {
struct m68hc11_scan_param param; struct m68hc11_scan_param param;

View File

@ -32,9 +32,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define BFD_M68HC11_BANK_VIRTUAL_NAME "__bank_virtual" #define BFD_M68HC11_BANK_VIRTUAL_NAME "__bank_virtual"
/* Set and control ELF flags in ELF header. */ /* Set and control ELF flags in ELF header. */
extern bfd_boolean _bfd_m68hc11_elf_merge_private_bfd_data PARAMS ((bfd*,bfd*)); extern bfd_boolean _bfd_m68hc11_elf_merge_private_bfd_data (bfd*,bfd*);
extern bfd_boolean _bfd_m68hc11_elf_set_private_flags PARAMS ((bfd*,flagword)); extern bfd_boolean _bfd_m68hc11_elf_set_private_flags (bfd*,flagword);
extern bfd_boolean _bfd_m68hc11_elf_print_private_bfd_data PARAMS ((bfd*,PTR)); extern bfd_boolean _bfd_m68hc11_elf_print_private_bfd_data (bfd*, void*);
/* This hash entry is used to record a trampoline that must be generated /* This hash entry is used to record a trampoline that must be generated
to call a far function using a normal calling convention ('jsr'). to call a far function using a normal calling convention ('jsr').
@ -122,8 +122,8 @@ struct m68hc11_elf_link_hash_table
/* Small local sym to section mapping cache. */ /* Small local sym to section mapping cache. */
struct sym_sec_cache sym_sec; struct sym_sec_cache sym_sec;
bfd_boolean (* size_one_stub) PARAMS((struct bfd_hash_entry*, PTR)); bfd_boolean (* size_one_stub) PARAMS((struct bfd_hash_entry*, void*));
bfd_boolean (* build_one_stub) PARAMS((struct bfd_hash_entry*, PTR)); bfd_boolean (* build_one_stub) PARAMS((struct bfd_hash_entry*, void*));
}; };
/* Get the Sparc64 ELF linker hash table from a link_info structure. */ /* Get the Sparc64 ELF linker hash table from a link_info structure. */
@ -134,71 +134,63 @@ struct m68hc11_elf_link_hash_table
/* Create a 68HC11/68HC12 ELF linker hash table. */ /* Create a 68HC11/68HC12 ELF linker hash table. */
extern struct m68hc11_elf_link_hash_table* m68hc11_elf_hash_table_create extern struct m68hc11_elf_link_hash_table* m68hc11_elf_hash_table_create
PARAMS ((bfd*)); (bfd*);
extern void m68hc11_elf_bfd_link_hash_table_free extern void m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table*);
PARAMS ((struct bfd_link_hash_table*));
extern void m68hc11_elf_get_bank_parameters extern void m68hc11_elf_get_bank_parameters (struct bfd_link_info*);
PARAMS ((struct bfd_link_info*));
/* Return 1 if the address is in banked memory. /* Return 1 if the address is in banked memory.
This can be applied to a virtual address and to a physical address. */ This can be applied to a virtual address and to a physical address. */
extern int m68hc11_addr_is_banked extern int m68hc11_addr_is_banked (struct m68hc11_page_info*, bfd_vma);
PARAMS ((struct m68hc11_page_info*, bfd_vma));
/* Return the physical address seen by the processor, taking /* Return the physical address seen by the processor, taking
into account banked memory. */ into account banked memory. */
extern bfd_vma m68hc11_phys_addr extern bfd_vma m68hc11_phys_addr (struct m68hc11_page_info*, bfd_vma);
PARAMS ((struct m68hc11_page_info*, bfd_vma));
/* Return the page number corresponding to an address in banked memory. */ /* Return the page number corresponding to an address in banked memory. */
extern bfd_vma m68hc11_phys_page extern bfd_vma m68hc11_phys_page (struct m68hc11_page_info*, bfd_vma);
PARAMS ((struct m68hc11_page_info*, bfd_vma));
bfd_reloc_status_type m68hc11_elf_ignore_reloc bfd_reloc_status_type m68hc11_elf_ignore_reloc
PARAMS ((bfd *abfd, arelent *reloc_entry, (bfd *abfd, arelent *reloc_entry,
asymbol *symbol, PTR data, asection *input_section, asymbol *symbol, void *data, asection *input_section,
bfd *output_bfd, char **error_message)); bfd *output_bfd, char **error_message);
bfd_reloc_status_type m68hc11_elf_special_reloc bfd_reloc_status_type m68hc11_elf_special_reloc
PARAMS ((bfd *abfd, arelent *reloc_entry, (bfd *abfd, arelent *reloc_entry,
asymbol *symbol, PTR data, asection *input_section, asymbol *symbol, void *data, asection *input_section,
bfd *output_bfd, char **error_message)); bfd *output_bfd, char **error_message);
/* GC mark and sweep. */ /* GC mark and sweep. */
asection *elf32_m68hc11_gc_mark_hook asection *elf32_m68hc11_gc_mark_hook
PARAMS ((asection *sec, struct bfd_link_info *info, (asection *sec, struct bfd_link_info *info,
Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h,
Elf_Internal_Sym *sym)); Elf_Internal_Sym *sym);
bfd_boolean elf32_m68hc11_gc_sweep_hook bfd_boolean elf32_m68hc11_gc_sweep_hook
PARAMS ((bfd *abfd, struct bfd_link_info *info, (bfd *abfd, struct bfd_link_info *info,
asection *sec, const Elf_Internal_Rela *relocs)); asection *sec, const Elf_Internal_Rela *relocs);
bfd_boolean elf32_m68hc11_check_relocs bfd_boolean elf32_m68hc11_check_relocs
PARAMS ((bfd * abfd, struct bfd_link_info * info, (bfd * abfd, struct bfd_link_info * info,
asection * sec, const Elf_Internal_Rela * relocs)); asection * sec, const Elf_Internal_Rela * relocs);
bfd_boolean elf32_m68hc11_relocate_section bfd_boolean elf32_m68hc11_relocate_section
PARAMS ((bfd *output_bfd, struct bfd_link_info *info, (bfd *output_bfd, struct bfd_link_info *info,
bfd *input_bfd, asection *input_section, bfd *input_bfd, asection *input_section,
bfd_byte *contents, Elf_Internal_Rela *relocs, bfd_byte *contents, Elf_Internal_Rela *relocs,
Elf_Internal_Sym *local_syms, asection **local_sections)); Elf_Internal_Sym *local_syms, asection **local_sections);
bfd_boolean elf32_m68hc11_add_symbol_hook bfd_boolean elf32_m68hc11_add_symbol_hook
PARAMS ((bfd *abfd, struct bfd_link_info *info, (bfd *abfd, struct bfd_link_info *info,
const Elf_Internal_Sym *sym, const char **namep, const Elf_Internal_Sym *sym, const char **namep,
flagword *flagsp, asection **secp, flagword *flagsp, asection **secp,
bfd_vma *valp)); bfd_vma *valp);
/* Tweak the OSABI field of the elf header. */ /* Tweak the OSABI field of the elf header. */
extern void elf32_m68hc11_post_process_headers extern void elf32_m68hc11_post_process_headers (bfd*, struct bfd_link_info*);
PARAMS ((bfd*, struct bfd_link_info*));
int elf32_m68hc11_setup_section_lists int elf32_m68hc11_setup_section_lists (bfd *, struct bfd_link_info *);
PARAMS ((bfd *, struct bfd_link_info *));
bfd_boolean elf32_m68hc11_size_stubs bfd_boolean elf32_m68hc11_size_stubs
PARAMS ((bfd *, bfd *, struct bfd_link_info *, (bfd *, bfd *, struct bfd_link_info *,
asection * (*) PARAMS ((const char *, asection *)))); asection * (*) (const char *, asection *));
bfd_boolean elf32_m68hc11_build_stubs bfd_boolean elf32_m68hc11_build_stubs (bfd* abfd, struct bfd_link_info *);
PARAMS ((bfd* abfd, struct bfd_link_info *));
#endif #endif