asection **input_list;
Elf_Internal_Sym **all_local_syms;
- /* Short-cuts to get to dynamic linker sections. */
- asection *sdynbss;
- asection *srelbss;
-
/* Used during a final link to store the base of the text and data
segments so that we can perform SEGREL relocations. */
bfd_vma text_segment_base;
if (! _bfd_elf_create_dynamic_sections (abfd, info))
return FALSE;
- htab->sdynbss = bfd_get_linker_section (abfd, ".dynbss");
- htab->srelbss = bfd_get_linker_section (abfd, ".rela.bss");
-
/* hppa-linux needs _GLOBAL_OFFSET_TABLE_ to be visible from the main
application, because __canonicalize_funcptr_for_compare needs it. */
eh = elf_hash_table (info)->hgot;
/* If called to transfer flags for a weakdef during processing
of elf_adjust_dynamic_symbol, don't copy non_got_ref.
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
- eh_dir->ref_dynamic |= eh_ind->ref_dynamic;
+ if (eh_dir->versioned != versioned_hidden)
+ eh_dir->ref_dynamic |= eh_ind->ref_dynamic;
eh_dir->ref_regular |= eh_ind->ref_regular;
eh_dir->ref_regular_nonweak |= eh_ind->ref_regular_nonweak;
eh_dir->needs_plt |= eh_ind->needs_plt;
}
else
{
- if (eh_ind->root.type == bfd_link_hash_indirect
- && eh_dir->got.refcount <= 0)
- {
- hh_dir->tls_type = hh_ind->tls_type;
- hh_ind->tls_type = GOT_UNKNOWN;
- }
+ if (eh_ind->root.type == bfd_link_hash_indirect)
+ {
+ hh_dir->plabel |= hh_ind->plabel;
+ hh_dir->tls_type |= hh_ind->tls_type;
+ hh_ind->tls_type = GOT_UNKNOWN;
+ }
_bfd_elf_link_hash_copy_indirect (info, eh_dir, eh_ind);
}
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->srelbss->size += sizeof (Elf32_External_Rela);
+ srel->size += sizeof (Elf32_External_Rela);
eh->needs_copy = 1;
}
- sec = htab->sdynbss;
-
return _bfd_elf_adjust_dynamic_copy (info, eh, sec);
}
}
}
else if (sec == htab->etab.sgot
- || sec == htab->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->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);
}
s = htab->etab.srelplt;
dyn.d_un.d_val = s->size;
break;
-
- case DT_RELASZ:
- /* Don't count procedure linkage table relocs in the
- overall reloc count. */
- s = htab->etab.srelplt;
- if (s == NULL)
- continue;
- dyn.d_un.d_val -= s->size;
- break;
-
- case DT_RELA:
- /* We may not be using the standard ELF linker script.
- If .rela.plt is the first .rela section, we adjust
- DT_RELA to not include it. */
- s = htab->etab.srelplt;
- if (s == NULL)
- continue;
- if (dyn.d_un.d_ptr != s->output_section->vma + s->output_offset)
- continue;
- dyn.d_un.d_ptr += s->size;
- break;
}
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
#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
#define TARGET_BIG_SYM hppa_elf32_vec
#define TARGET_BIG_NAME "elf32-hppa"