/* IA-64 support for 64-bit ELF
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2017 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."),
- sec->owner, sec, (unsigned long) roff);
+ (_("%B: Can't relax br at %#Lx in section `%A'."
+ " Please use brl or indirect branch."),
+ sec->owner, roff, sec);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
/* Copy down any references that we may have already seen to the
symbol which just became indirect. */
- dir->root.ref_dynamic |= ind->root.ref_dynamic;
+ if (dir->root.versioned != versioned_hidden)
+ dir->root.ref_dynamic |= ind->root.ref_dynamic;
dir->root.ref_regular |= ind->root.ref_regular;
dir->root.ref_regular_nonweak |= ind->root.ref_regular_nonweak;
dir->root.needs_plt |= ind->root.needs_plt;
else
h = NULL;
+ if (h && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
+ continue;
+
/* We can only get preliminary data on whether a symbol is
locally or externally defined, as not all of the input files
have yet been processed. Do something with what we know, as
/* PR15323, ref flags aren't set for references in the same
object. */
- h->root.non_ir_ref = 1;
+ h->root.non_ir_ref_regular = 1;
h->ref_regular = 1;
}
else
h = NULL;
+ if (h && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
+ continue;
+
/* We can only get preliminary data on whether a symbol is
locally or externally defined, as not all of the input files
have yet been processed. Do something with what we know, as
if (!bfd_link_executable (x->info)
&& (!h
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ && !UNDEFWEAK_NO_DYNAMIC_RELOC (x->info, h))
|| (h->root.type != bfd_link_hash_undefweak
&& h->root.type != bfd_link_hash_undefined)))
{
shared = bfd_link_pic (x->info);
resolved_zero = (dyn_i->h
- && ELF_ST_VISIBILITY (dyn_i->h->other)
- && dyn_i->h->root.type == bfd_link_hash_undefweak);
+ && UNDEFWEAK_NO_DYNAMIC_RELOC (x->info,
+ dyn_i->h));
/* Take care of the GOT and PLT relocations. */
/* If this is a weak symbol, and there is a real definition, the
processor independent code will have arranged for us to see the
real definition first, and we can just use the same value. */
- if (h->u.weakdef != NULL)
+ if (h->is_weakalias)
{
- BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
- || h->u.weakdef->root.type == bfd_link_hash_defweak);
- h->root.u.def.section = h->u.weakdef->root.u.def.section;
- h->root.u.def.value = h->u.weakdef->root.u.def.value;
+ struct elf_link_hash_entry *def = weakdef (h);
+ BFD_ASSERT (def->root.type == bfd_link_hash_defined);
+ h->root.u.def.section = def->root.u.def.section;
+ h->root.u.def.value = def->root.u.def.value;
return TRUE;
}
/* Install a dynamic relocation if needed. */
if (((bfd_link_pic (info)
&& (!dyn_i->h
- || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
+ || (ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
+ && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, dyn_i->h))
|| dyn_i->h->root.type != bfd_link_hash_undefweak)
&& dyn_r_type != R_IA64_DTPREL32LSB
&& dyn_r_type != R_IA64_DTPREL64LSB)
if (!is_plt
&& bfd_link_pic (info)
&& (!dyn_i->h
- || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
+ || (ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
+ && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, dyn_i->h))
|| dyn_i->h->root.type != bfd_link_hash_undefweak))
{
unsigned int dyn_r_type;
overflow:
_bfd_error_handler
/* xgettext:c-format */
- (_("%s: short data segment overflowed (0x%lx >= 0x400000)"),
- bfd_get_filename (abfd),
- (unsigned long) (max_short_vma - min_short_vma));
+ (_("%B: short data segment overflowed (%#Lx >= 0x400000)"),
+ abfd, max_short_vma - min_short_vma);
return FALSE;
}
else if ((gp_val > min_short_vma
&& max_short_vma - gp_val >= 0x200000))
{
_bfd_error_handler
- (_("%s: __gp does not cover short data segment"),
- bfd_get_filename (abfd));
+ (_("%B: __gp does not cover short data segment"), abfd);
return FALSE;
}
}
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: unknown relocation type %d"),
- input_bfd, (int) r_type);
+ (_("%B: unknown relocation type %d"), input_bfd, (int) r_type);
bfd_set_error (bfd_error_bad_value);
ret_val = FALSE;
continue;
case R_IA64_DIR64LSB:
/* Install a dynamic relocation for this reloc. */
if ((dynamic_symbol_p || bfd_link_pic (info))
+ && !(h && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
&& r_symndx != STN_UNDEF
&& (input_section->flags & SEC_ALLOC) != 0)
{
case R_IA64_LTOFF_DTPREL22:
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: missing TLS section for relocation %s against `%s' at 0x%lx in section `%A'."),
- input_bfd, input_section, howto->name, name,
- rel->r_offset);
+ (_("%B: missing TLS section for relocation %s against `%s'"
+ " at %#Lx in section `%A'."),
+ input_bfd, howto->name, name,
+ rel->r_offset, input_section);
break;
case R_IA64_PCREL21B:
that the section is too big to relax. */
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> 0x1000000)."),
- input_bfd, input_section, howto->name, name,
- rel->r_offset, input_section->size);
+ (_("%B: Can't relax br (%s) to `%s' at %#Lx"
+ " in section `%A' with size %#Lx (> 0x1000000)."),
+ input_bfd, howto->name, name, rel->r_offset,
+ input_section, input_section->size);
break;
}
/* Fall through. */
dyn.d_un.d_ptr = (sgotplt->output_section->vma
+ sgotplt->output_offset);
break;
-
- case DT_RELASZ:
- /* Do not have RELASZ include JMPREL. This makes things
- easier on ld.so. This is not what the rest of BFD set up. */
- dyn.d_un.d_val -= (ia64_info->minplt_entries
- * sizeof (ElfNN_External_Rela));
- break;
}
bfd_elfNN_swap_dyn_out (abfd, &dyn, dyncon);
#define elf_backend_fixup_symbol _bfd_elf_link_hash_fixup_symbol
#define elf_backend_reloc_type_class elfNN_ia64_reloc_type_class
#define elf_backend_rela_normal 1
+#define elf_backend_dtrel_excludes_plt 1
#define elf_backend_special_sections elfNN_ia64_special_sections
#define elf_backend_default_execstack 0