From b3293efaf8ddef1eba52de14be47e3d33bbce35a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 7 Aug 2017 18:02:49 +0930 Subject: [PATCH] PR21910, segfault in common symbol override test when hash-style=gnu PR 21910 * elflink.c (bfd_elf_final_link): Don't segfault when sections needed to define various dynamic tags have been discarded. --- bfd/ChangeLog | 6 ++++++ bfd/elflink.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 694675f138..5d04571717 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2017-08-07 Alan Modra + + PR 21910 + * elflink.c (bfd_elf_final_link): Don't segfault when sections + needed to define various dynamic tags have been discarded. + 2017-08-07 Nick Clifton PR 21884 diff --git a/bfd/elflink.c b/bfd/elflink.c index 0cc5f871db..b89d537df5 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -12342,7 +12342,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) get_vma: o = bfd_get_linker_section (dynobj, name); do_vma: - if (o == NULL) + if (o == NULL || bfd_is_abs_section (o->output_section)) { _bfd_error_handler (_("could not find section %s"), name); -- 2.34.1