X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felf32-m68hc11.c;h=7bbb48962d2e86f3df36624d342cd6032541140b;hb=refs%2Fheads%2Fconcurrent-displaced-stepping-2020-04-01;hp=828a43299ad728d86693dd12d2fc1d10ddead26e;hpb=06f44071ccbeca33fff70b928b71d95a15982740;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index 828a43299a..7bbb48962d 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -1,5 +1,5 @@ /* Motorola 68HC11-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) (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) @@ -415,6 +415,14 @@ m68hc11_elf_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) stub_entry = (struct elf32_m68hc11_stub_hash_entry *) gen_entry; info = (struct bfd_link_info *) in_arg; + /* Fail if the target section could not be assigned to an output + section. The user should fix his linker script. */ + if (stub_entry->target_section->output_section == NULL + && info->non_contiguous_regions) + info->callbacks->einfo (_("%F%P: Could not assign '%pA' to an output section. " + "Retry without --enable-non-contiguous-regions.\n"), + stub_entry->target_section); + htab = m68hc11_elf_hash_table (info); if (htab == NULL) return FALSE; @@ -1074,11 +1082,8 @@ m68hc11_elf_relax_section (bfd *abfd, asection *sec, prev_insn_group = 0; } - if (free_relocs != NULL) - { - free (free_relocs); - free_relocs = NULL; - } + free (free_relocs); + free_relocs = NULL; if (free_contents != NULL) { @@ -1107,12 +1112,9 @@ m68hc11_elf_relax_section (bfd *abfd, asection *sec, return TRUE; error_return: - if (free_relocs != NULL) - free (free_relocs); - if (free_contents != NULL) - free (free_contents); - if (free_extsyms != NULL) - free (free_extsyms); + free (free_relocs); + free (free_contents); + free (free_extsyms); return FALSE; }