/* i370-specific support for 32-bit ELF
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2017 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
Hacked by Linas Vepstas for i370 linas@linas.org
r_type = ELF32_R_TYPE (dst->r_info);
if (r_type >= R_I370_max)
{
+ /* xgettext:c-format */
_bfd_error_handler (_("%B: unrecognised I370 reloc number: %d"),
abfd, r_type);
bfd_set_error (bfd_error_bad_value);
else /* Incompatible flags. */
{
_bfd_error_handler
- ("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)",
- ibfd, (long) new_flags, (long) old_flags);
+ /* xgettext:c-format */
+ (_("%B: uses different e_flags (%#x) fields than previous modules (%#x)"),
+ ibfd, new_flags, old_flags);
bfd_set_error (bfd_error_bad_value);
return FALSE;
/* Make sure we know what is going on here. */
BFD_ASSERT (dynobj != NULL
&& (h->needs_plt
- || h->u.weakdef != NULL
+ || h->is_weakalias
|| (h->def_dynamic
&& h->ref_regular
&& !h->def_regular)));
/* 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;
}
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- /* PR15323, ref flags aren't set for references in the same
- object. */
- h->root.non_ir_ref = 1;
}
if (bfd_link_pic (info))
{
asection *sdyn;
bfd *dynobj = elf_hash_table (info)->dynobj;
- asection *sgot = bfd_get_linker_section (dynobj, ".got");
+ asection *sgot = elf_hash_table (info)->sgot;
#ifdef DEBUG
fprintf (stderr, "i370_elf_finish_dynamic_sections called\n");
asection *splt;
Elf32_External_Dyn *dyncon, *dynconend;
- splt = bfd_get_linker_section (dynobj, ".plt");
+ splt = elf_hash_table (info)->splt;
BFD_ASSERT (splt != NULL && sdyn != NULL);
dyncon = (Elf32_External_Dyn *) sdyn->contents;
for (; dyncon < dynconend; dyncon++)
{
Elf_Internal_Dyn dyn;
- const char *name;
+ asection *s;
bfd_boolean size;
bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
switch (dyn.d_tag)
{
- case DT_PLTGOT: name = ".plt"; size = FALSE; break;
- case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break;
- case DT_JMPREL: name = ".rela.plt"; size = FALSE; break;
- default: name = NULL; size = FALSE; break;
+ case DT_PLTGOT:
+ s = elf_hash_table (info)->splt;
+ size = FALSE;
+ break;
+ case DT_PLTRELSZ:
+ s = elf_hash_table (info)->srelplt;
+ size = TRUE;
+ break;
+ case DT_JMPREL:
+ s = elf_hash_table (info)->srelplt;
+ size = FALSE;
+ break;
+ default:
+ continue;
}
- if (name != NULL)
+ if (s == NULL)
+ dyn.d_un.d_val = 0;
+ else
{
- asection *s;
-
- s = bfd_get_linker_section (dynobj, name);
- if (s == NULL)
- dyn.d_un.d_val = 0;
+ if (!size)
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
else
- {
- if (! size)
- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
- else
- dyn.d_un.d_val = s->size;
- }
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ dyn.d_un.d_val = s->size;
}
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
}
}
bfd_boolean ret = TRUE;
#ifdef DEBUG
- _bfd_error_handler ("i370_elf_relocate_section called for %B section %A, %ld relocations%s",
+ _bfd_error_handler ("i370_elf_relocate_section called for %B section %A, %u relocations%s",
input_bfd, input_section,
- (long) input_section->reloc_count,
+ input_section->reloc_count,
(bfd_link_relocatable (info)) ? " (relocatable)" : "");
#endif
if ((unsigned) r_type >= (unsigned) R_I370_max
|| !i370_elf_howto_table[(int)r_type])
{
- _bfd_error_handler ("%B: unknown relocation type %d",
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%B: unknown relocation type %d"),
input_bfd, (int) r_type);
bfd_set_error (bfd_error_bad_value);
{
default:
_bfd_error_handler
- ("%B: unknown relocation type %d for symbol %s",
+ (_("%B: unknown relocation type %d for symbol %s"),
input_bfd, (int) r_type, sym_name);
bfd_set_error (bfd_error_bad_value);
case (int) R_I370_COPY:
case (int) R_I370_RELATIVE:
_bfd_error_handler
- ("%B: Relocation %s is not yet supported for symbol %s.",
+ /* xgettext:c-format */
+ (_("%B: Relocation %s is not yet supported for symbol %s."),
input_bfd,
i370_elf_howto_table[(int) r_type]->name,
sym_name);