cmse_scan segfault
authorAlan Modra <amodra@gmail.com>
Wed, 24 Oct 2018 04:38:28 +0000 (15:08 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 24 Oct 2018 13:08:52 +0000 (23:38 +1030)
elf_sym_hashes for as-needed libs will be zeroed if the library is
found to be not needed.  More than that, the local symbols for such a
library should not be considered by cmse_scan.

* elf32-arm.c (elf32_arm_size_stubs): Ignore as-needed libs that
were not needed.

bfd/ChangeLog
bfd/elf32-arm.c

index c5f7ec7874566c396c9b8dce83ee9d7c753ae93f..7e9fb6837c53d19915fc45206500b95d0ee70bac 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-24  Alan Modra  <amodra@gmail.com>
+
+       * elf32-arm.c (elf32_arm_size_stubs): Ignore as-needed libs that
+       were not needed.
+
 2018-10-23  Alan Modra  <amodra@gmail.com>
 
        PR 23806
index 2c321bbcb65455b10b223316acbad03e27a0b1b3..5adec5e47318510e8fd1911436b3715c86c9a20c 100644 (file)
@@ -6449,7 +6449,8 @@ elf32_arm_size_stubs (bfd *output_bfd,
          asection *section;
          Elf_Internal_Sym *local_syms = NULL;
 
-         if (!is_arm_elf (input_bfd))
+         if (!is_arm_elf (input_bfd)
+             || (elf_dyn_lib_class (input_bfd) & DYN_AS_NEEDED) != 0)
            continue;
 
          num_a8_relocs = 0;