/* BFD back-end for HP PA-RISC ELF files.
- Copyright (C) 1990-2016 Free Software Foundation, Inc.
+ Copyright (C) 1990-2017 Free Software Foundation, Inc.
Original code by
Center for Software Science
/* PR15323, ref flags aren't set for references in the same
object. */
- hh->eh.root.non_ir_ref = 1;
+ hh->eh.root.non_ir_ref_regular = 1;
}
r_type = ELF32_R_TYPE (rela->r_info);
return _bfd_elf_adjust_dynamic_copy (info, eh, sec);
}
+/* Make an undefined weak symbol dynamic. */
+
+static bfd_boolean
+ensure_undef_weak_dynamic (struct bfd_link_info *info,
+ struct elf_link_hash_entry *eh)
+{
+ if (eh->dynindx == -1
+ && !eh->forced_local
+ && eh->type != STT_PARISC_MILLI
+ && eh->root.type == bfd_link_hash_undefweak
+ && ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT)
+ return bfd_elf_link_record_dynamic_symbol (info, eh);
+ return TRUE;
+}
+
/* Allocate space in the .plt for entries that won't have relocations.
ie. plabel entries. */
if (htab->etab.dynamic_sections_created
&& eh->plt.refcount > 0)
{
- /* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
- if (eh->dynindx == -1
- && !eh->forced_local
- && eh->type != STT_PARISC_MILLI)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, eh))
- return FALSE;
- }
+ if (!ensure_undef_weak_dynamic (info, eh))
+ return FALSE;
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), eh))
{
sec = htab->etab.splt;
eh->plt.offset = sec->size;
sec->size += PLT_ENTRY_SIZE;
+ if (bfd_link_pic (info))
+ htab->etab.srelplt->size += sizeof (Elf32_External_Rela);
}
else
{
if (eh->got.refcount > 0)
{
- /* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
- if (eh->dynindx == -1
- && !eh->forced_local
- && eh->type != STT_PARISC_MILLI)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, eh))
- return FALSE;
- }
+ if (!ensure_undef_weak_dynamic (info, eh))
+ return FALSE;
sec = htab->etab.sgot;
eh->got.offset = sec->size;
if (ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT)
hh->dyn_relocs = NULL;
- /* Make sure undefined weak symbols are output as a dynamic
- symbol in PIEs. */
- else if (eh->dynindx == -1
- && !eh->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, eh))
- return FALSE;
- }
+ else if (!ensure_undef_weak_dynamic (info, eh))
+ return FALSE;
}
}
else
&& (eh->root.type == bfd_link_hash_undefweak
|| eh->root.type == bfd_link_hash_undefined))))
{
- /* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
- if (eh->dynindx == -1
- && !eh->forced_local
- && eh->type != STT_PARISC_MILLI)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, eh))
- return FALSE;
- }
+ if (!ensure_undef_weak_dynamic (info, eh))
+ return FALSE;
/* If that succeeded, we know we'll be keeping all the
relocs. */
+ 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)
+ if (eh->root.u.def.section == htab->etab.sdynrelro)
sec = htab->etab.sreldynrelro;
else
sec = htab->etab.srelbss;
#define elf_backend_want_dynrelro 1
#define elf_backend_rela_normal 1
#define elf_backend_dtrel_excludes_plt 1
+#define elf_backend_no_page_alias 1
#define TARGET_BIG_SYM hppa_elf32_vec
#define TARGET_BIG_NAME "elf32-hppa"