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] [BFD][AARCH64]Refactor to facilitate further large memory model support patches.


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

commit a0becb8948afaf3dcb7c39884464a51aa35a9cd9
Author: Renlin Li <renlin.li@arm.com>
Date:   Fri Oct 2 14:35:06 2015 +0100

    [BFD][AARCH64]Refactor to facilitate further large memory model support patches.
    
    bfd/
    
    2015-10-02  Renlin Li  <renlin.li@arm.com>
    
    	* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Change if to
    	switch statement.

Diff:
---
 bfd/ChangeLog       |  5 +++++
 bfd/elfnn-aarch64.c | 16 ++++++++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c4312c8..b33cb3c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-02  Renlin Li  <renlin.li@arm.com>
+
+	* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Change if to
+	switch statement.
+
 2015-10-01  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR ld/19031
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 90ab3f8..2157ccd 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -5022,10 +5022,18 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
 	    value = aarch64_calculate_got_entry_vma (h, globals, info,
 						     value, output_bfd,
 						     unresolved_reloc_p);
-	  if (bfd_r_type == BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15
-	      || bfd_r_type == BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14)
-	    addend = (globals->root.sgot->output_section->vma
-		      + globals->root.sgot->output_offset);
+
+	  switch (bfd_r_type)
+	    {
+	    case BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14:
+	    case BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15:
+	      addend = (globals->root.sgot->output_section->vma
+			+ globals->root.sgot->output_offset);
+	      break;
+	    default:
+	      break;
+	    }
+
 	  value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
 						       addend, weak_undef_p);
 	  return _bfd_aarch64_elf_put_addend (input_bfd, hit_data, bfd_r_type, howto, value);


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