Blame SOURCES/binutils-aarch64-gold-PLT-for-MOVW_ABS.patch

8c00d6
--- binutils.orig/gold/aarch64.cc	2019-05-21 11:24:07.642560743 +0100
8c00d6
+++ binutils-2.32/gold/aarch64.cc	2019-05-21 11:25:02.425157682 +0100
8c00d6
@@ -6496,6 +6496,17 @@ Target_aarch64<size, big_endian>::Scan::
8c00d6
 	  gold_error(_("%s: unsupported reloc %u in pos independent link."),
8c00d6
 		     object->name().c_str(), r_type);
8c00d6
 	}
8c00d6
+      // Make a PLT entry if necessary.
8c00d6
+      if (gsym->needs_plt_entry())
8c00d6
+	{
8c00d6
+	  target->make_plt_entry(symtab, layout, gsym);
8c00d6
+	  // Since this is not a PC-relative relocation, we may be
8c00d6
+	  // taking the address of a function. In that case we need to
8c00d6
+	  // set the entry in the dynamic symbol table to the address of
8c00d6
+	  // the PLT entry.
8c00d6
+	  if (gsym->is_from_dynobj() && !parameters->options().shared())
8c00d6
+	    gsym->set_needs_dynsym_value();
8c00d6
+	}
8c00d6
       break;
8c00d6
 
8c00d6
     case elfcpp::R_AARCH64_LD_PREL_LO19:        // 273