View | Details | Raw Unified | Return to bug 16177 | Differences between
and this patch

Collapse All | Expand All

(-)binutils-2.39/bfd/elf32-arm.c (-6 / +19 lines)
Lines 16196-16201 elf32_arm_adjust_dynamic_symbol (struct Link Here
16196
  if (bfd_link_pic (info) || globals->root.is_relocatable_executable)
16196
  if (bfd_link_pic (info) || globals->root.is_relocatable_executable)
16197
    return true;
16197
    return true;
16198
16198
16199
  /* If -z nocopyreloc was given, we won't generate them either.  */
16200
  if (info->nocopyreloc)
16201
    {
16202
      h->non_got_ref = 0;
16203
      return true;
16204
    }
16205
16206
  /* If we don't find any dynamic relocs in read-only sections, then
16207
     we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
16208
  if (!_bfd_elf_readonly_dynrelocs (h))
16209
    {
16210
      h->non_got_ref = 0;
16211
      return true;
16212
    }
16213
16199
  /* We must allocate the symbol in our .dynbss section, which will
16214
  /* We must allocate the symbol in our .dynbss section, which will
16200
     become part of the .bss section of the executable.  There will be
16215
     become part of the .bss section of the executable.  There will be
16201
     an entry for this symbol in the .dynsym section.  The dynamic
16216
     an entry for this symbol in the .dynsym section.  The dynamic
Lines 16205-16213 elf32_arm_adjust_dynamic_symbol (struct Link Here
16205
     determine the address it must put in the global offset table, so
16220
     determine the address it must put in the global offset table, so
16206
     both the dynamic object and the regular object will refer to the
16221
     both the dynamic object and the regular object will refer to the
16207
     same memory location for the variable.  */
16222
     same memory location for the variable.  */
16208
  /* If allowed, we must generate a R_ARM_COPY reloc to tell the dynamic
16223
  /* We must generate a R_ARM_COPY reloc to tell the dynamic linker to
16209
     linker to copy the initial value out of the dynamic object and into
16224
     copy the initial value out of the dynamic object and into the
16210
     the runtime process image.  We need to remember the offset into the
16225
     runtime process image.  We need to remember the offset into the
16211
     .rel(a).bss section we are going to use.  */
16226
     .rel(a).bss section we are going to use.  */
16212
  if ((h->root.u.def.section->flags & SEC_READONLY) != 0)
16227
  if ((h->root.u.def.section->flags & SEC_READONLY) != 0)
16213
    {
16228
    {
Lines 16219-16227 elf32_arm_adjust_dynamic_symbol (struct Link Here
16219
      s = globals->root.sdynbss;
16234
      s = globals->root.sdynbss;
16220
      srel = globals->root.srelbss;
16235
      srel = globals->root.srelbss;
16221
    }
16236
    }
16222
  if (info->nocopyreloc == 0
16237
  if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
16223
      && (h->root.u.def.section->flags & SEC_ALLOC) != 0
16224
      && h->size != 0)
16225
    {
16238
    {
16226
      elf32_arm_allocate_dynrelocs (info, srel, 1);
16239
      elf32_arm_allocate_dynrelocs (info, srel, 1);
16227
      h->needs_copy = 1;
16240
      h->needs_copy = 1;

Return to bug 16177