{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"),
+ (_("%B(%A+%#Lx): cannot reach %s, recompile with -ffunction-sections"),
hsh->target_section->owner,
stub_sec,
- (long) hsh->stub_offset,
+ hsh->stub_offset,
hsh->bh_root.string);
bfd_set_error (bfd_error_bad_value);
return FALSE;
/* 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. */
+/* If EH is undefined, make it dynamic if that makes sense. */
static bfd_boolean
-ensure_undef_weak_dynamic (struct bfd_link_info *info,
- struct elf_link_hash_entry *eh)
+ensure_undef_dynamic (struct bfd_link_info *info,
+ struct elf_link_hash_entry *eh)
{
- if (eh->dynindx == -1
+ struct elf_link_hash_table *htab = elf_hash_table (info);
+
+ if (htab->dynamic_sections_created
+ && (eh->root.type == bfd_link_hash_undefweak
+ || eh->root.type == bfd_link_hash_undefined)
+ && 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;
if (htab->etab.dynamic_sections_created
&& eh->plt.refcount > 0)
{
- if (!ensure_undef_weak_dynamic (info, eh))
+ if (!ensure_undef_dynamic (info, eh))
return FALSE;
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), eh))
if (eh->got.refcount > 0)
{
- if (!ensure_undef_weak_dynamic (info, eh))
+ if (!ensure_undef_dynamic (info, eh))
return FALSE;
sec = htab->etab.sgot;
changes. */
if (bfd_link_pic (info))
{
+ /* Discard relocs on undefined syms with non-default visibility. */
+ if ((eh->root.type == bfd_link_hash_undefined
+ || eh->root.type == bfd_link_hash_undefweak)
+ && ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT)
+ hh->dyn_relocs = NULL;
+
#if RELATIVE_DYNRELOCS
- if (SYMBOL_CALLS_LOCAL (info, eh))
+ else if (SYMBOL_CALLS_LOCAL (info, eh))
{
struct elf32_hppa_dyn_reloc_entry **hdh_pp;
}
#endif
- /* Also discard relocs on undefined weak syms with non-default
- visibility. */
- if (hh->dyn_relocs != NULL
- && eh->root.type == bfd_link_hash_undefweak)
+ if (hh->dyn_relocs != NULL)
{
- if (ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT)
- hh->dyn_relocs = NULL;
-
- else if (!ensure_undef_weak_dynamic (info, eh))
+ if (!ensure_undef_dynamic (info, eh))
return FALSE;
}
}
&& (eh->root.type == bfd_link_hash_undefweak
|| eh->root.type == bfd_link_hash_undefined))))
{
- if (!ensure_undef_weak_dynamic (info, eh))
+ if (!ensure_undef_dynamic (info, eh))
return FALSE;
- /* If that succeeded, we know we'll be keeping all the
- relocs. */
- if (eh->dynindx != -1)
- goto keep;
+ if (eh->dynindx == -1)
+ hh->dyn_relocs = NULL;
}
-
- hh->dyn_relocs = NULL;
- return TRUE;
-
- keep: ;
+ else
+ hh->dyn_relocs = NULL;
}
/* Finally, allocate space. */
struct bfd_link_hash_entry *h;
asection *sec = NULL;
bfd_vma gp_val = 0;
- struct elf32_hppa_link_hash_table *htab;
- htab = hppa_link_hash_table (info);
- if (htab == NULL)
- return FALSE;
-
- h = bfd_link_hash_lookup (&htab->etab.root, "$global$", FALSE, FALSE, FALSE);
+ h = bfd_link_hash_lookup (info->hash, "$global$", FALSE, FALSE, FALSE);
if (h != NULL
&& (h->type == bfd_link_hash_defined
}
}
- if (sec != NULL && sec->output_section != NULL)
- gp_val += sec->output_section->vma + sec->output_offset;
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
+ {
+ if (sec != NULL && sec->output_section != NULL)
+ gp_val += sec->output_section->vma + sec->output_offset;
- elf_gp (abfd) = gp_val;
+ elf_gp (abfd) = gp_val;
+ }
return TRUE;
}
error. */
_bfd_error_handler
/* xgettext:c-format */
- (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
+ (_("%B(%A+%#Lx): %s fixup for insn %#x is not supported in a non-shared link"),
input_bfd,
input_section,
- (long) offset,
+ offset,
howto->name,
insn);
}
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"),
+ (_("%B(%A+%#Lx): cannot reach %s, recompile with -ffunction-sections"),
input_bfd,
input_section,
- (long) offset,
+ offset,
hsh->bh_root.string);
bfd_set_error (bfd_error_bad_value);
return bfd_reloc_notsupported;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B(%A+0x%lx): cannot handle %s for %s"),
+ (_("%B(%A+%#Lx): cannot handle %s for %s"),
input_bfd,
input_section,
- (long) rela->r_offset,
+ rela->r_offset,
howto->name,
sym_name);
bfd_set_error (bfd_error_bad_value);