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

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