Comment # 16 on bug 1170826 from
I have added a comment to the open Go upstream issue tracking the dependency on
gold: https://github.com/golang/go/issues/22040#issuecomment-673580134
asking for feedback on whether the proposed binutils patch proposed in
https://sourceware.org/bugzilla/show_bug.cgi?id=19962 would address the issues
with ld on arm and aarch64:

--- a/bfd/elf32-arm.c    
+++ a/bfd/elf32-arm.c    
@@ -14112,11 +14112,15 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info
* info,
   s = bfd_get_linker_section (dynobj, ".dynbss");
   BFD_ASSERT (s != NULL);

-  /* We must generate a R_ARM_COPY reloc to tell the dynamic linker to
-     copy the initial value out of the dynamic object and into the
-     runtime process image.  We need to remember the offset into the
+  /* If allowed, we must generate a R_ARM_COPY reloc to tell the dynamic
+     linker to copy the initial value out of the dynamic object and into
+     the runtime process image.  We need to remember the offset into the
      .rel(a).bss section we are going to use.  */
-  if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
+  if (info->nocopyreloc == 0
+      && (h->root.u.def.section->flags & SEC_ALLOC) != 0
+      /* PR 16177: A copy is only needed if the input section is readonly.  */
+      && (h->root.u.def.section->flags & SEC_READONLY) == 0
+      && h->size != 0)
     {
       asection *srel;


You are receiving this mail because: