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

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