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

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