This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[1/16][binutils][AARCH64]Add relocation support for large memory model. [BFD] simply refactor to facilitate further patch.
- From: Renlin Li <renlin dot li at arm dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, Jiong Wang <jiong dot wang at arm dot com>, Nicholas Clifton <nickc at redhat dot com>
- Date: Tue, 08 Sep 2015 16:59:08 +0100
- Subject: [1/16][binutils][AARCH64]Add relocation support for large memory model. [BFD] simply refactor to facilitate further patch.
- Authentication-results: sourceware.org; auth=none
Hi all,
This is a simple refactor patch to change if to switch statement to
facilitate new relocation support added later.
Okay to commit?
bfd/ChangeLog:
2015-09-08 Renlin Li <renlin.li@arm.com>
* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Change if to
switch statement.
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index e5b92e1..c61d1e3 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -4774,10 +4774,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);