This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix second bug where --icf=safe triggers segfault when linking ARM.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d83d54033545c0e7b668950b127753c88a33f950

commit d83d54033545c0e7b668950b127753c88a33f950
Author: Cary Coutant <ccoutant@gmail.com>
Date:   Thu Apr 19 10:20:08 2018 -0700

    Fix second 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.
    The previous fix for this bug fixed the call to
    scan.global_reloc_may_be_function_pointer, but missed the similar
    call to scan.local_reloc_may_be_function_pointer.
    
    gold/
    	PR gold/23046
    	* gc.h (gc_process_relocs): Pass target to
    	scan.local_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 270ba8a..bc17a9e 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-19  Cary Coutant  <ccoutant@gmail.com>
+
+	PR gold/23046
+	* gc.h (gc_process_relocs): Pass target to
+	scan.local_reloc_may_be_function_pointer.
+
 2018-04-18  Nick Clifton  <nickc@redhat.com>
 
 	* po/es.po: Updated Spanish translation.
diff --git a/gold/gc.h b/gold/gc.h
index 00f383f..7c79c23 100644
--- a/gold/gc.h
+++ b/gold/gc.h
@@ -263,7 +263,7 @@ gc_process_relocs(
 	  if (is_ordinary
 	      && check_section_for_function_pointers
               && lsym.get_st_type() != elfcpp::STT_OBJECT
- 	      && scan.local_reloc_may_be_function_pointer(symtab, NULL, NULL,
+ 	      && scan.local_reloc_may_be_function_pointer(symtab, NULL, target,
 							  src_obj, src_indx,
 			                       		  NULL, reloc, r_type,
 							  lsym))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]