diff options
author | Nick Clifton <nickc@redhat.com> | 2012-07-26 13:43:24 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2012-07-26 13:43:24 +0000 |
commit | 054565943aa9abff8ffa9ab848eeae3873f27395 (patch) | |
tree | 19c29f167261b81b54b37f72edd07c9e1c203884 /bfd/elf32-arm.c | |
parent | 29f7799750d2821a82d596892b5d59e8c91c5587 (diff) | |
download | gdb-054565943aa9abff8ffa9ab848eeae3873f27395.zip gdb-054565943aa9abff8ffa9ab848eeae3873f27395.tar.gz gdb-054565943aa9abff8ffa9ab848eeae3873f27395.tar.bz2 |
PR ld/14397
* elf32-arm.c (elf32_arm_finish_dynamic_sections): Report an error
if a required section is missing from the linker script.
* ld-arm/arm-elf.exp: Add tests of linking without .rel.plt.
* ld-arm/arm-no-rel-plt.out: Linker script without .rel.plt section.
* ld-arm/arm-no-rel-plt.out: Expected output.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r-- | bfd/elf32-arm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 1bbd96c..4f2d00e 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -14083,7 +14083,14 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info name = RELOC_SECTION (htab, ".plt"); get_vma: s = bfd_get_section_by_name (output_bfd, name); - BFD_ASSERT (s != NULL); + if (s == NULL) + { + /* PR ld/14397: Issue an error message if a required section is missing. */ + (*_bfd_error_handler) + (_("error: required section '%s' not found in the linker script"), name); + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } if (!htab->symbian_p) dyn.d_un.d_ptr = s->vma; else |