/* Motorola 68HC11/HC12-specific support for 32-bit ELF
- Copyright (C) 1999-2019 Free Software Foundation, Inc.
+ Copyright (C) 1999-2020 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@nerim.fr)
This file is part of BFD, the Binary File Descriptor library.
m68hc11_elf_hash_table_create (bfd *abfd)
{
struct m68hc11_elf_link_hash_table *ret;
- bfd_size_type amt = sizeof (struct m68hc11_elf_link_hash_table);
+ size_t amt = sizeof (struct m68hc11_elf_link_hash_table);
ret = (struct m68hc11_elf_link_hash_table *) bfd_zmalloc (amt);
if (ret == (struct m68hc11_elf_link_hash_table *) NULL)
unsigned int top_id, top_index;
asection *section;
asection **input_list, **list;
- bfd_size_type amt;
+ size_t amt;
asection *text_section;
struct m68hc11_elf_link_hash_table *htab;
asection *section;
Elf_Internal_Sym *local_syms, **all_local_syms;
unsigned int bfd_indx, bfd_count;
- bfd_size_type amt;
+ size_t amt;
asection *stub_sec;
struct m68hc11_elf_link_hash_table *htab = m68hc11_elf_hash_table (info);
return TRUE;
}
-static bfd_boolean
+static bfd_boolean ATTRIBUTE_PRINTF (6, 7)
reloc_warning (struct bfd_link_info *info, const char *name, bfd *input_bfd,
asection *input_section, const Elf_Internal_Rela *rel,
const char *fmt, ...)
case R_M68HC11_16:
if (is_far)
{
- msg = _("reference to the far symbol `%s' using a wrong "
- "relocation may result in incorrect execution");
if (!reloc_warning (info, name, input_bfd, input_section, rel,
- msg, name))
+ _("reference to the far symbol `%s' using a "
+ "wrong relocation may result in incorrect "
+ "execution"), name))
return FALSE;
}
}
else
{
- msg = _("XGATE address (%lx) is not within shared RAM"
- "(0xE000-0xFFFF), therefore you must manually offset "
- "the address, and possibly manage the page, in your "
- "code.");
if (!reloc_warning (info, name, input_bfd, input_section, rel,
- msg, (long) phys_addr))
+ _("XGATE address (%lx) is not within "
+ "shared RAM(0xE000-0xFFFF), therefore "
+ "you must manually offset the address, "
+ "and possibly manage the page, in your "
+ "code."), (long) phys_addr))
return FALSE;
break;
}
&& phys_page != insn_page
&& !(e_flags & E_M68HC11_NO_BANK_WARNING))
{
- /* xgettext:c-format */
- msg = _("banked address [%lx:%04lx] (%lx) is not in the same "
- "bank as current banked address [%lx:%04lx] (%lx)");
if (!reloc_warning (info, name, input_bfd, input_section, rel,
- msg, (long) phys_page, (long) phys_addr,
+ _("banked address [%lx:%04lx] (%lx) is not "
+ "in the same bank as current banked "
+ "address [%lx:%04lx] (%lx)"),
+ (long) phys_page, (long) phys_addr,
(long) (relocation + rel->r_addend),
(long) insn_page,
(long) m68hc11_phys_addr (pinfo, insn_addr),
if (phys_page != 0 && insn_page == 0)
{
- /* xgettext:c-format */
- msg = _("reference to a banked address [%lx:%04lx] in the "
- "normal address space at %04lx");
if (!reloc_warning (info, name, input_bfd, input_section, rel,
- msg, (long) phys_page, (long) phys_addr,
+ _("reference to a banked address [%lx:%04lx] "
+ "in the normal address space at %04lx"),
+ (long) phys_page, (long) phys_addr,
(long) insn_addr))
return FALSE;
relocation = phys_addr;
relocation += 0xC000;
else
{
- msg = _("S12 address (%lx) is not within shared RAM"
- "(0x2000-0x4000), therefore you must manually "
- "offset the address in your code");
if (!reloc_warning (info, name, input_bfd, input_section, rel,
- msg, (long) phys_addr))
+ _("S12 address (%lx) is not within "
+ "shared RAM(0x2000-0x4000), therefore "
+ "you must manually offset the address "
+ "in your code"), (long) phys_addr))
return FALSE;
break;
}
/* Tweak the OSABI field of the elf header. */
-void
-elf32_m68hc11_post_process_headers (bfd *abfd, struct bfd_link_info *link_info)
+bfd_boolean
+elf32_m68hc11_init_file_header (bfd *abfd, struct bfd_link_info *link_info)
{
struct m68hc11_scan_param param;
struct m68hc11_elf_link_hash_table *htab;
- _bfd_elf_post_process_headers (abfd, link_info);
+ if (!_bfd_elf_init_file_header (abfd, link_info))
+ return FALSE;
if (link_info == NULL)
- return;
+ return TRUE;
htab = m68hc11_elf_hash_table (link_info);
if (htab == NULL)
- return;
+ return TRUE;
m68hc11_elf_get_bank_parameters (link_info);
i_ehdrp = elf_elfheader (abfd);
i_ehdrp->e_flags |= E_M68HC12_BANKS;
}
+ return TRUE;
}