Patch for PR gold/19042 - unsupported reloc 311/312.
authorHan Shen <shenhan@google.com>
Tue, 27 Oct 2015 22:17:54 +0000 (15:17 -0700)
committerHan Shen <shenhan@google.com>
Tue, 27 Oct 2015 22:22:41 +0000 (15:22 -0700)
gold/

* aarch64.cc (Target_aarch64::Scan::local): Add support for
reloc 311/312.

gold/ChangeLog
gold/aarch64.cc

index 46a0636d8e6f2b1662e786a75730144c5267191d..dc1c0ea2e2f80ca2611728526e5ba33f0397aaa0 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2015-10-22  H.J. Lu  <hongjiu.lu@intel.com>
 
        * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
index 2e3c42afdaa60d2404ef6726cdd5e60513664367..275d94c308af51567f91e512d566b2347dee9a55 100644 (file)
@@ -5987,6 +5987,29 @@ Target_aarch64<size, big_endian>::Scan::local(
     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
This page took 0.032779 seconds and 4 git commands to generate.