struct m68hc11_elf_link_hash_table *ret;
bfd_size_type amt = sizeof (struct m68hc11_elf_link_hash_table);
- ret = (struct m68hc11_elf_link_hash_table *) bfd_malloc (amt);
+ ret = (struct m68hc11_elf_link_hash_table *) bfd_zmalloc (amt);
if (ret == (struct m68hc11_elf_link_hash_table *) NULL)
return NULL;
- memset (ret, 0, amt);
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
_bfd_elf_link_hash_newfunc,
sizeof (struct elf_link_hash_entry),
sizeof (struct elf32_m68hc11_stub_hash_entry)))
return NULL;
- ret->stub_bfd = NULL;
- ret->stub_section = 0;
- ret->add_stub_section = NULL;
- ret->sym_cache.abfd = NULL;
-
return ret;
}
bfd_hash_table_free (ret->stub_hash_table);
free (ret->stub_hash_table);
- _bfd_generic_link_hash_table_free (hash);
+ _bfd_elf_link_hash_table_free (hash);
}
/* Assorted hash table functions. */
/* Build the stubs as directed by the stub hash table. */
table = htab->stub_hash_table;
bfd_hash_traverse (table, m68hc11_elf_export_one_stub, info);
-
+
/* Scan the output sections to see if we use the memory banks.
If so, export the symbols that define how the memory banks
are mapped. This is used by gdb and the simulator to obtain
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ /* PR15323, ref flags aren't set for references in the same
+ object. */
+ h->root.non_ir_ref = 1;
}
switch (ELF32_R_TYPE (rel->r_info))
struct m68hc11_page_info *pinfo;
const struct elf_backend_data * const ebd = get_elf_backend_data (input_bfd);
struct m68hc11_elf_link_hash_table *htab;
+ unsigned long e_flags;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
+ e_flags = elf_elfheader (input_bfd)->e_flags;
htab = m68hc11_elf_hash_table (info);
if (htab == NULL)
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation, unresolved_reloc,
- warned);
+ warned, ignored);
is_far = (h && (h->other & STO_M68HC12_FAR));
is_xgate_symbol = (h && (h->target_internal));
a LO8XG. Does not actually check that it was a LO8XG.
Adjusts high and low bytes. */
relocation = phys_addr;
- if ((elf_elfheader (input_bfd)->e_flags & E_M68HC11_XGATE_RAMOFFSET)
+ if ((e_flags & E_M68HC11_XGATE_RAMOFFSET)
&& (relocation >= 0x2000))
relocation += 0xc000; /* HARDCODED RAM offset for XGATE. */
"relocation may result in incorrect execution");
buf = alloca (strlen (msg) + strlen (name) + 10);
sprintf (buf, msg, name);
-
+
(* info->callbacks->warning)
(info, buf, name, input_bfd, NULL, rel->r_offset);
}
if (m68hc11_addr_is_banked (pinfo, relocation + rel->r_addend)
&& m68hc11_addr_is_banked (pinfo, insn_addr)
- && phys_page != insn_page)
+ && phys_page != insn_page && !(e_flags & E_M68HC11_NO_BANK_WARNING))
{
const char * msg;
char * buf;
else if (elf_elfheader (abfd)->e_flags & EF_M68HCS12_MACH)
fprintf (file, _("cpu=HCS12]"));
else
- fprintf (file, _("cpu=HC12]"));
+ fprintf (file, _("cpu=HC12]"));
if (elf_elfheader (abfd)->e_flags & E_M68HC12_BANKS)
fprintf (file, _(" [memory=bank-model]"));
if (asect->vma >= p->pinfo->bank_virtual)
p->use_memory_banks = TRUE;
}
-
+
/* Tweak the OSABI field of the elf header. */
void