]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix second bug where --icf=safe triggers segfault when linking ARM.
authorCary Coutant <ccoutant@gmail.com>
Thu, 19 Apr 2018 17:20:08 +0000 (10:20 -0700)
committerCary Coutant <ccoutant@gmail.com>
Thu, 19 Apr 2018 17:20:08 +0000 (10:20 -0700)
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.

gold/ChangeLog
gold/gc.h

index 270ba8af1bbf6e497008cdf9f987c39d28a5ebe0..bc17a9ea1f84a4df3fd8369b830aec62ad8fabf0 100644 (file)
@@ -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.
index 00f383f443493ab302aa7e45e3189e4bbe12836e..7c79c23aa955717a119a6a63cf6dcca44693e9e4 100644 (file)
--- 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))