This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fix bug where --icf=safe triggers segfault when linking ARM.
- From: Cary Coutant <ccoutant at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 14 Apr 2018 22:58:27 -0000
- Subject: [binutils-gdb] Fix bug where --icf=safe triggers segfault when linking ARM.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aae8280935aab812c3666d1c5c0ea099e96927cc
commit aae8280935aab812c3666d1c5c0ea099e96927cc
Author: Cary Coutant <ccoutant@gmail.com>
Date: Sat Apr 14 15:58:07 2018 -0700
Fix bug where --icf=safe triggers segfault when linking ARM.
When checking a R_ARM_TARGET[12] relocation, we need a valid target
pointer, but the garbage collection code was passing a NULL instead.
gold/
PR gold/23046
* gc.h (gc_process_relocs): Pass target to
scan.global_reloc_may_be_function_pointer.
Diff:
---
gold/ChangeLog | 6 ++++++
gold/gc.h | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/gold/ChangeLog b/gold/ChangeLog
index fa73173..b86812c 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-14 Cary Coutant <ccoutant@gmail.com>
+
+ PR gold/23046
+ * gc.h (gc_process_relocs): Pass target to
+ scan.global_reloc_may_be_function_pointer.
+
2018-04-09 Alan Modra <amodra@gmail.com>
* configure: Regenerate.
diff --git a/gold/gc.h b/gold/gc.h
index eda332c..00f383f 100644
--- a/gold/gc.h
+++ b/gold/gc.h
@@ -300,7 +300,7 @@ gc_process_relocs(
&& dst_obj != NULL
&& (!is_ordinary
|| scan.global_reloc_may_be_function_pointer(
- symtab, NULL, NULL, src_obj, src_indx, NULL, reloc,
+ symtab, NULL, target, src_obj, src_indx, NULL, reloc,
r_type, gsym)))
symtab->icf()->set_section_has_function_pointers(dst_obj, dst_indx);