This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] cmse_scan segfault
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 24 Oct 2018 13:12:35 -0000
- Subject: [binutils-gdb] cmse_scan segfault
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8c246a60c08d82066b16973bcd622e671300eb02
commit 8c246a60c08d82066b16973bcd622e671300eb02
Author: Alan Modra <amodra@gmail.com>
Date: Wed Oct 24 15:08:28 2018 +1030
cmse_scan segfault
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.
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/elf32-arm.c | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c5f7ec7..7e9fb68 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 2c321bb..5adec5e 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -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;