[binutils-gdb] Fix AArch64 stub layout algorithm to allow for the fact that section layut might change a stub's tar

Nick Clifton nickc@sourceware.org
Wed Aug 22 09:05:00 GMT 2018


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

commit 3da64fe404031c093e8b59565d935fed214e28c1
Author: Rafeal Auler <rafaelauler@gmail.com>
Date:   Wed Aug 22 10:04:09 2018 +0100

    Fix AArch64 stub layout algorithm to allow for the fact that section layut might change a stub's target location.
    
    	PR 23560
    	* elfnn-aarch64.c (elfNN_aarch64_size_stubs): Always update the
    	stub's target, since it may have been changed after the layout.

Diff:
---
 bfd/ChangeLog       | 6 ++++++
 bfd/elfnn-aarch64.c | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6eac668..6946a65 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2018-08-22  Rafeal Auler  <rafaelauler@gmail.com>
+
+	PR 23560
+	* elfnn-aarch64.c (elfNN_aarch64_size_stubs): Always update the
+	stub's target, since it may have been changed after the layout.
+
 2018-08-21  John Darington  <john@darrington.wattle.id.au>
 
 	* elf32-s12z.c (opru18_reloc): New function.
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 8681444..ee09cd7 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -4414,6 +4414,9 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
 		    {
 		      /* The proper stub has already been created.  */
 		      free (stub_name);
+		      /* Always update this stub's target since it may have
+			 changed after layout.  */
+		      stub_entry->target_value = sym_value + irela->r_addend;
 		      continue;
 		    }



More information about the Binutils-cvs mailing list