This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold][aarch64] PR gold/19042 - unsupported reloc 311/312.
- From: Han Shen <shenhan at google dot com>
- To: binutils <binutils at sourceware dot org>, Cary Coutant <ccoutant at gmail dot com>
- Cc: Luis Lozano <llozano at google dot com>, Andreas Schwab <schwab at linux-m68k dot org>
- Date: Tue, 27 Oct 2015 14:15:55 -0700
- Subject: [gold][aarch64] PR gold/19042 - unsupported reloc 311/312.
- Authentication-results: sourceware.org; auth=none
Hi Cary, this is the patch to fix PR gold/19042 - unsupported reloc 311/312.
Tested - build on x86_64 (-O2 and -O0) and aarch64 host (-O2), passed
bug test case.
2015-10-27 Han Shen <shenhan@google.com>
PR gold/19042 - unsupported reloc 311/312.
* aarch64.cc (Target_aarch64::Scan::local): Add support for
reloc 311/312.
Ok for trunk?
Thanks,
Han
diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index 2e3c42a..275d94c 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -5985,10 +5985,33 @@ Target_aarch64<size, big_endian>::Scan::local(
case elfcpp::R_AARCH64_PREL64:
case elfcpp::R_AARCH64_PREL32:
case elfcpp::R_AARCH64_PREL16:
break;
+ case elfcpp::R_AARCH64_ADR_GOT_PAGE:
+ case elfcpp::R_AARCH64_LD64_GOT_LO12_NC:
+ // This pair of relocations is used to access a specific GOT entry.
+ {
+ bool is_new = false;
+ // This symbol requires a GOT entry.
+ if (is_ifunc)
+ is_new = got->add_local_plt(object, r_sym, GOT_TYPE_STANDARD);
+ else
+ is_new = got->add_local(object, r_sym, GOT_TYPE_STANDARD);
+ if (is_new && parameters->options().output_is_position_independent())
+ target->rela_dyn_section(layout)->
+ add_local_relative(object,
+ r_sym,
+ elfcpp::R_AARCH64_RELATIVE,
+ got,
+ object->local_got_offset(r_sym,
+ GOT_TYPE_STANDARD),
+ 0,
+ false);
+ }
+ break;
+
case elfcpp::R_AARCH64_LD_PREL_LO19: // 273
case elfcpp::R_AARCH64_ADR_PREL_LO21: // 274
case elfcpp::R_AARCH64_ADR_PREL_PG_HI21: // 275
case elfcpp::R_AARCH64_ADR_PREL_PG_HI21_NC: // 276
case elfcpp::R_AARCH64_ADD_ABS_LO12_NC: // 277