struct elf_link_hash_entry *eh)
{
struct elf32_hppa_link_hash_table *htab;
- asection *sec;
+ asection *sec, *srel;
/* If this is a function, put it in the procedure linkage table. We
will fill in the contents of the procedure linkage table later. */
/* We must generate a COPY reloc to tell the dynamic linker to
copy the initial value out of the dynamic object and into the
runtime process image. */
+ if ((eh->root.u.def.section->flags & SEC_READONLY) != 0)
+ {
+ sec = htab->etab.sdynrelro;
+ srel = htab->etab.sreldynrelro;
+ }
+ else
+ {
+ sec = htab->etab.sdynbss;
+ srel = htab->etab.srelbss;
+ }
if ((eh->root.u.def.section->flags & SEC_ALLOC) != 0 && eh->size != 0)
{
- htab->etab.srelbss->size += sizeof (Elf32_External_Rela);
+ srel->size += sizeof (Elf32_External_Rela);
eh->needs_copy = 1;
}
- sec = htab->etab.sdynbss;
-
return _bfd_elf_adjust_dynamic_copy (info, eh, sec);
}
}
}
else if (sec == htab->etab.sgot
- || sec == htab->etab.sdynbss)
+ || sec == htab->etab.sdynbss
+ || sec == htab->etab.sdynrelro)
;
else if (CONST_STRNEQ (bfd_get_section_name (dynobj, sec), ".rela"))
{
|| eh->root.type == bfd_link_hash_defweak)))
abort ();
- sec = htab->etab.srelbss;
-
rela.r_offset = (eh->root.u.def.value
+ eh->root.u.def.section->output_offset
+ eh->root.u.def.section->output_section->vma);
rela.r_addend = 0;
rela.r_info = ELF32_R_INFO (eh->dynindx, R_PARISC_COPY);
+ if ((eh->root.u.def.section->flags & SEC_READONLY) != 0)
+ sec = htab->etab.sreldynrelro;
+ else
+ sec = htab->etab.srelbss;
loc = sec->contents + sec->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
}
#define elf_backend_plt_readonly 0
#define elf_backend_want_plt_sym 0
#define elf_backend_got_header_size 8
+#define elf_backend_want_dynrelro 1
#define elf_backend_rela_normal 1
#define elf_backend_dtrel_excludes_plt 1