* elf32-frv.c: Use info->callbacks->einfo throughout file in linker

functions rather than warning callback or _bfd_error_handler.
	* elf32-ppc.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf32-ppc.c (ppc_elf_tls_optimize): Use %H in __tls_get_addr lost
	arg error.
	* elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
This commit is contained in:
Alan Modra 2011-05-23 06:14:21 +00:00
parent 270396f296
commit 25f53a85d7
4 changed files with 196 additions and 213 deletions

View file

@ -1,3 +1,13 @@
2011-05-23 Alan Modra <amodra@gmail.com>
* elf32-frv.c: Use info->callbacks->einfo throughout file in linker
functions rather than warning callback or _bfd_error_handler.
* elf32-ppc.c: Likewise.
* elf64-ppc.c: Likewise.
* elf32-ppc.c (ppc_elf_tls_optimize): Use %H in __tls_get_addr lost
arg error.
* elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
2011-05-23 Alan Modra <amodra@gmail.com> 2011-05-23 Alan Modra <amodra@gmail.com>
PR 12763 PR 12763

View file

@ -1,5 +1,5 @@
/* FRV-specific support for 32-bit ELF. /* FRV-specific support for 32-bit ELF.
Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -2884,8 +2884,9 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
osec, sym, osec, sym,
rel->r_addend)) rel->r_addend))
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%x): relocation to `%s+%x' may have caused the error above"), (_("%H: relocation to `%s+%v'"
" may have caused the error above\n"),
input_bfd, input_section, rel->r_offset, name, rel->r_addend); input_bfd, input_section, rel->r_offset, name, rel->r_addend);
return FALSE; return FALSE;
} }
@ -2897,9 +2898,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
picrel = NULL; picrel = NULL;
if (h && ! FRVFDPIC_SYM_LOCAL (info, h)) if (h && ! FRVFDPIC_SYM_LOCAL (info, h))
{ {
info->callbacks->warning info->callbacks->einfo
(info, _("relocation references symbol not defined in the module"), (_("%H: relocation references symbol"
name, input_bfd, input_section, rel->r_offset); " not defined in the module\n"),
input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
break; break;
@ -2972,10 +2974,9 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this a call instruction? */ /* Is this a call instruction? */
if ((insn & (unsigned long)0x01fc0000) != 0x003c0000) if ((insn & (unsigned long)0x01fc0000) != 0x003c0000)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_GETTLSOFF not applied to a call instruction\n"),
_("R_FRV_GETTLSOFF not applied to a call instruction"), input_bfd, input_section, rel->r_offset);
name, input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3014,10 +3015,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this an lddi instruction? */ /* Is this an lddi instruction? */
if ((insn & (unsigned long)0x01fc0000) != 0x00cc0000) if ((insn & (unsigned long)0x01fc0000) != 0x00cc0000)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_GOTTLSDESC12"
_("R_FRV_GOTTLSDESC12 not applied to an lddi instruction"), " not applied to an lddi instruction\n"),
name, input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3085,10 +3086,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this a sethi instruction? */ /* Is this a sethi instruction? */
if ((insn & (unsigned long)0x01ff0000) != 0x00f80000) if ((insn & (unsigned long)0x01ff0000) != 0x00f80000)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_GOTTLSDESCHI"
_("R_FRV_GOTTLSDESCHI not applied to a sethi instruction"), " not applied to a sethi instruction\n"),
name, input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3122,11 +3123,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this a setlo or setlos instruction? */ /* Is this a setlo or setlos instruction? */
if ((insn & (unsigned long)0x01f70000) != 0x00f40000) if ((insn & (unsigned long)0x01f70000) != 0x00f40000)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_GOTTLSDESCLO"
_("R_FRV_GOTTLSDESCLO" " not applied to a setlo or setlos instruction\n"),
" not applied to a setlo or setlos instruction"), input_bfd, input_section, rel->r_offset);
name, input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3170,10 +3170,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this an ldd instruction? */ /* Is this an ldd instruction? */
if ((insn & (unsigned long)0x01fc0fc0) != 0x00080140) if ((insn & (unsigned long)0x01fc0fc0) != 0x00080140)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_TLSDESC_RELAX"
_("R_FRV_TLSDESC_RELAX not applied to an ldd instruction"), " not applied to an ldd instruction\n"),
name, input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3254,11 +3254,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this a calll or callil instruction? */ /* Is this a calll or callil instruction? */
if ((insn & (unsigned long)0x7ff80fc0) != 0x02300000) if ((insn & (unsigned long)0x7ff80fc0) != 0x02300000)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_GETTLSOFF_RELAX"
_("R_FRV_GETTLSOFF_RELAX" " not applied to a calll instruction\n"),
" not applied to a calll instruction"), input_bfd, input_section, rel->r_offset);
name, input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3309,10 +3308,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this an ldi instruction? */ /* Is this an ldi instruction? */
if ((insn & (unsigned long)0x01fc0000) != 0x00c80000) if ((insn & (unsigned long)0x01fc0000) != 0x00c80000)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_GOTTLSOFF12"
_("R_FRV_GOTTLSOFF12 not applied to an ldi instruction"), " not applied to an ldi instruction\n"),
name, input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3339,10 +3338,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this a sethi instruction? */ /* Is this a sethi instruction? */
if ((insn & (unsigned long)0x01ff0000) != 0x00f80000) if ((insn & (unsigned long)0x01ff0000) != 0x00f80000)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_GOTTLSOFFHI"
_("R_FRV_GOTTLSOFFHI not applied to a sethi instruction"), " not applied to a sethi instruction\n"),
name, input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3368,11 +3367,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this a setlo or setlos instruction? */ /* Is this a setlo or setlos instruction? */
if ((insn & (unsigned long)0x01f70000) != 0x00f40000) if ((insn & (unsigned long)0x01f70000) != 0x00f40000)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_GOTTLSOFFLO"
_("R_FRV_GOTTLSOFFLO" " not applied to a setlo or setlos instruction\n"),
" not applied to a setlo or setlos instruction"), input_bfd, input_section, rel->r_offset);
name, input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3399,10 +3397,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this an ld instruction? */ /* Is this an ld instruction? */
if ((insn & (unsigned long)0x01fc0fc0) != 0x00080100) if ((insn & (unsigned long)0x01fc0fc0) != 0x00080100)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_TLSOFF_RELAX"
_("R_FRV_TLSOFF_RELAX not applied to an ld instruction"), " not applied to an ld instruction\n"),
name, input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3444,10 +3442,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this a sethi instruction? */ /* Is this a sethi instruction? */
if ((insn & (unsigned long)0x01ff0000) != 0x00f80000) if ((insn & (unsigned long)0x01ff0000) != 0x00f80000)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("%H: R_FRV_TLSMOFFHI"
_("R_FRV_TLSMOFFHI not applied to a sethi instruction"), " not applied to a sethi instruction\n"),
name, input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3471,11 +3469,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
/* Is this a setlo or setlos instruction? */ /* Is this a setlo or setlos instruction? */
if ((insn & (unsigned long)0x01f70000) != 0x00f40000) if ((insn & (unsigned long)0x01f70000) != 0x00f40000)
{ {
r = info->callbacks->warning info->callbacks->einfo
(info, (_("R_FRV_TLSMOFFLO"
_("R_FRV_TLSMOFFLO" " not applied to a setlo or setlos instruction\n"),
" not applied to a setlo or setlos instruction"), input_bfd, input_section, rel->r_offset);
name, input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3593,9 +3590,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
if (addend) if (addend)
{ {
info->callbacks->warning info->callbacks->einfo
(info, _("R_FRV_FUNCDESC references dynamic symbol with nonzero addend"), (_("%H: R_FRV_FUNCDESC references dynamic symbol"
name, input_bfd, input_section, rel->r_offset); " with nonzero addend\n"),
input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
dynindx = h->dynindx; dynindx = h->dynindx;
@ -3633,10 +3631,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
input_section input_section
->output_section)) ->output_section))
{ {
info->callbacks->warning info->callbacks->einfo
(info, (_("%H: cannot emit fixups"
_("cannot emit fixups in read-only section"), " in read-only section\n"),
name, input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3664,10 +3662,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
input_section input_section
->output_section)) ->output_section))
{ {
info->callbacks->warning info->callbacks->einfo
(info, (_("%H: cannot emit dynamic relocations"
_("cannot emit dynamic relocations in read-only section"), " in read-only section\n"),
name, input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3713,9 +3711,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
if (addend && r_type == R_FRV_FUNCDESC_VALUE) if (addend && r_type == R_FRV_FUNCDESC_VALUE)
{ {
info->callbacks->warning info->callbacks->einfo
(info, _("R_FRV_FUNCDESC_VALUE references dynamic symbol with nonzero addend"), (_("%H: R_FRV_FUNCDESC_VALUE"
name, input_bfd, input_section, rel->r_offset); " references dynamic symbol with nonzero addend\n"),
input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
dynindx = h->dynindx; dynindx = h->dynindx;
@ -3754,10 +3753,9 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
input_section input_section
->output_section)) ->output_section))
{ {
info->callbacks->warning info->callbacks->einfo
(info, (_("%H: cannot emit fixups in read-only section\n"),
_("cannot emit fixups in read-only section"), input_bfd, input_section, rel->r_offset);
name, input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
if (!h || h->root.type != bfd_link_hash_undefweak) if (!h || h->root.type != bfd_link_hash_undefweak)
@ -3798,10 +3796,10 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
input_section input_section
->output_section)) ->output_section))
{ {
info->callbacks->warning info->callbacks->einfo
(info, (_("%H: cannot emit dynamic relocations"
_("cannot emit dynamic relocations in read-only section"), " in read-only section\n"),
name, input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
return FALSE; return FALSE;
} }
@ -3969,16 +3967,9 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
&& !(picrel && picrel->symndx == -1 && !(picrel && picrel->symndx == -1
&& picrel->d.h->root.type == bfd_link_hash_undefined)) && picrel->d.h->root.type == bfd_link_hash_undefined))
{ {
if (info->shared || info->pie) info->callbacks->einfo
(*_bfd_error_handler) (_("%H: reloc against `%s' references a different segment\n"),
(_("%B(%A+0x%lx): reloc against `%s': %s"), input_bfd, input_section, rel->r_offset, name);
input_bfd, input_section, (long)rel->r_offset, name,
_("relocation references a different segment"));
else
info->callbacks->warning
(info,
_("relocation references a different segment"),
name, input_bfd, input_section, rel->r_offset);
} }
if (!silence_segment_error && (info->shared || info->pie)) if (!silence_segment_error && (info->shared || info->pie))
return FALSE; return FALSE;
@ -4126,9 +4117,9 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
if (msg) if (msg)
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): reloc against `%s': %s"), (_("%H: reloc against `%s': %s\n"),
input_bfd, input_section, (long)rel->r_offset, name, msg); input_bfd, input_section, rel->r_offset, name, msg);
return FALSE; return FALSE;
} }
@ -5882,8 +5873,8 @@ elf32_frvfdpic_finish_dynamic_sections (bfd *output_bfd,
!= (frvfdpic_gotfixup_section (info)->reloc_count * 4)) != (frvfdpic_gotfixup_section (info)->reloc_count * 4))
{ {
error: error:
(*_bfd_error_handler) info->callbacks->einfo
("LINKER BUG: .rofixup section size mismatch"); ("LINKER BUG: .rofixup section size mismatch\n");
return FALSE; return FALSE;
} }
@ -6402,8 +6393,8 @@ elf32_frv_check_relocs (abfd, info, sec, relocs)
default: default:
bad_reloc: bad_reloc:
(*_bfd_error_handler) info->callbacks->einfo
(_("%B: unsupported relocation type %i"), (_("%B: unsupported relocation type %i\n"),
abfd, ELF32_R_TYPE (rel->r_info)); abfd, ELF32_R_TYPE (rel->r_info));
return FALSE; return FALSE;
} }

View file

@ -1,6 +1,7 @@
/* PowerPC-specific support for 32-bit ELF /* PowerPC-specific support for 32-bit ELF
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support. Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -3703,12 +3704,9 @@ ppc_elf_check_relocs (bfd *abfd,
{ {
/* It does not make sense to have a procedure linkage /* It does not make sense to have a procedure linkage
table entry for a local symbol. */ table entry for a local symbol. */
(*_bfd_error_handler) (_("%B(%A+0x%lx): %s reloc against " info->callbacks->einfo (_("%H: %s reloc against local symbol\n"),
"local symbol"), abfd, sec, rel->r_offset,
abfd, ppc_elf_howto_table[r_type]->name);
sec,
(long) rel->r_offset,
ppc_elf_howto_table[r_type]->name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -4704,7 +4702,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
&& !expecting_tls_get_addr && !expecting_tls_get_addr
&& is_branch_reloc (r_type)) && is_branch_reloc (r_type))
{ {
info->callbacks->minfo ("%C __tls_get_addr lost arg, " info->callbacks->minfo ("%H __tls_get_addr lost arg, "
"TLS optimization disabled\n", "TLS optimization disabled\n",
ibfd, sec, rel->r_offset); ibfd, sec, rel->r_offset);
if (elf_section_data (sec)->relocs != relstart) if (elf_section_data (sec)->relocs != relstart)
@ -4790,7 +4788,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
could just mark this symbol to exclude it could just mark this symbol to exclude it
from tls optimization but it's safer to skip from tls optimization but it's safer to skip
the entire optimization. */ the entire optimization. */
info->callbacks->minfo (_("%C arg lost __tls_get_addr, " info->callbacks->minfo (_("%H arg lost __tls_get_addr, "
"TLS optimization disabled\n"), "TLS optimization disabled\n"),
ibfd, sec, rel->r_offset); ibfd, sec, rel->r_offset);
if (elf_section_data (sec)->relocs != relstart) if (elf_section_data (sec)->relocs != relstart)
@ -5025,8 +5023,8 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
if (h->size == 0) if (h->size == 0)
{ {
(*_bfd_error_handler) (_("dynamic variable `%s' is zero size"), info->callbacks->einfo (_("dynamic variable `%s' is zero size\n"),
h->root.root.string); h->root.root.string);
return TRUE; return TRUE;
} }
@ -7222,8 +7220,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
switch (r_type) switch (r_type)
{ {
default: default:
(*_bfd_error_handler) info->callbacks->einfo
(_("%B: unknown relocation type %d for symbol %s"), (_("%B: unknown relocation type %d for symbol %s\n"),
input_bfd, (int) r_type, sym_name); input_bfd, (int) r_type, sym_name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -7483,11 +7481,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
generated by a hash table traversal, the value in the generated by a hash table traversal, the value in the
got at entry m+n bears little relation to the entry m. */ got at entry m+n bears little relation to the entry m. */
if (addend != 0) if (addend != 0)
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): non-zero addend on %s reloc against `%s'"), (_("%H: non-zero addend on %s reloc against `%s'\n"),
input_bfd, input_bfd, input_section, rel->r_offset,
input_section,
(long) rel->r_offset,
howto->name, howto->name,
sym_name); sym_name);
} }
@ -7681,12 +7677,10 @@ ppc_elf_relocate_section (bfd *output_bfd,
non-executable to apply text relocations. non-executable to apply text relocations.
So we'll segfault when trying to run the So we'll segfault when trying to run the
indirection function to resolve the reloc. */ indirection function to resolve the reloc. */
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): relocation %s for indirect " (_("%H: relocation %s for indirect "
"function %s unsupported"), "function %s unsupported\n"),
input_bfd, input_bfd, input_section, rel->r_offset,
input_section,
(long) rel->r_offset,
howto->name, howto->name,
sym_name); sym_name);
ret = FALSE; ret = FALSE;
@ -7911,9 +7905,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
|| (CONST_STRNEQ (name, ".sbss") || (CONST_STRNEQ (name, ".sbss")
&& (name[5] == 0 || name[5] == '.')))) && (name[5] == 0 || name[5] == '.'))))
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B: the target (%s) of a %s relocation is " (_("%B: the target (%s) of a %s relocation is "
"in the wrong output section (%s)"), "in the wrong output section (%s)\n"),
input_bfd, input_bfd,
sym_name, sym_name,
howto->name, howto->name,
@ -7941,9 +7935,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
if (! (CONST_STRNEQ (name, ".sdata2") if (! (CONST_STRNEQ (name, ".sdata2")
|| CONST_STRNEQ (name, ".sbss2"))) || CONST_STRNEQ (name, ".sbss2")))
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B: the target (%s) of a %s relocation is " (_("%B: the target (%s) of a %s relocation is "
"in the wrong output section (%s)"), "in the wrong output section (%s)\n"),
input_bfd, input_bfd,
sym_name, sym_name,
howto->name, howto->name,
@ -7988,9 +7982,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
} }
else else
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B: the target (%s) of a %s relocation is " (_("%B: the target (%s) of a %s relocation is "
"in the wrong output section (%s)"), "in the wrong output section (%s)\n"),
input_bfd, input_bfd,
sym_name, sym_name,
howto->name, howto->name,
@ -8060,8 +8054,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
case R_PPC_EMB_RELST_HI: case R_PPC_EMB_RELST_HI:
case R_PPC_EMB_RELST_HA: case R_PPC_EMB_RELST_HA:
case R_PPC_EMB_BIT_FLD: case R_PPC_EMB_BIT_FLD:
(*_bfd_error_handler) info->callbacks->einfo
(_("%B: relocation %s is not yet supported for symbol %s."), (_("%B: relocation %s is not yet supported for symbol %s\n"),
input_bfd, input_bfd,
howto->name, howto->name,
sym_name); sym_name);
@ -8119,11 +8113,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
&& !((input_section->flags & SEC_DEBUGGING) != 0 && !((input_section->flags & SEC_DEBUGGING) != 0
&& h->def_dynamic)) && h->def_dynamic))
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), (_("%H: unresolvable %s relocation against symbol `%s'\n"),
input_bfd, input_bfd, input_section, rel->r_offset,
input_section,
(long) rel->r_offset,
howto->name, howto->name,
sym_name); sym_name);
ret = FALSE; ret = FALSE;
@ -8168,10 +8160,10 @@ ppc_elf_relocate_section (bfd *output_bfd,
} }
else else
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): %s reloc against `%s': error %d"), (_("%H: %s reloc against `%s': error %d\n"),
input_bfd, input_section, input_bfd, input_section, rel->r_offset,
(long) rel->r_offset, howto->name, sym_name, (int) r); howto->name, sym_name, (int) r);
ret = FALSE; ret = FALSE;
} }
} }
@ -8660,10 +8652,10 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
} }
else else
{ {
(*_bfd_error_handler) (_("%s not defined in linker created %s"), info->callbacks->einfo (_("%s not defined in linker created %s\n"),
htab->elf.hgot->root.root.string, htab->elf.hgot->root.root.string,
(htab->sgotplt != NULL (htab->sgotplt != NULL
? htab->sgotplt->name : htab->got->name)); ? htab->sgotplt->name : htab->got->name));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ret = FALSE; ret = FALSE;
} }

View file

@ -4138,8 +4138,9 @@ ppc_get_stub_entry (const asection *input_section,
static struct ppc_stub_hash_entry * static struct ppc_stub_hash_entry *
ppc_add_stub (const char *stub_name, ppc_add_stub (const char *stub_name,
asection *section, asection *section,
struct ppc_link_hash_table *htab) struct bfd_link_info *info)
{ {
struct ppc_link_hash_table *htab = ppc_hash_table (info);
asection *link_sec; asection *link_sec;
asection *stub_sec; asection *stub_sec;
struct ppc_stub_hash_entry *stub_entry; struct ppc_stub_hash_entry *stub_entry;
@ -4176,8 +4177,8 @@ ppc_add_stub (const char *stub_name,
TRUE, FALSE); TRUE, FALSE);
if (stub_entry == NULL) if (stub_entry == NULL)
{ {
(*_bfd_error_handler) (_("%B: cannot create stub entry %s"), info->callbacks->einfo (_("%B: cannot create stub entry %s\n"),
section->owner, stub_name); section->owner, stub_name);
return NULL; return NULL;
} }
@ -6499,9 +6500,9 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
function pointers, vtable refs and suchlike in read-only function pointers, vtable refs and suchlike in read-only
sections. Allow them to proceed, but warn that this might sections. Allow them to proceed, but warn that this might
break at runtime. */ break at runtime. */
(*_bfd_error_handler) info->callbacks->einfo
(_("copy reloc against `%s' requires lazy plt linking; " (_("copy reloc against `%s' requires lazy plt linking; "
"avoid setting LD_BIND_NOW=1 or upgrade gcc"), "avoid setting LD_BIND_NOW=1 or upgrade gcc\n"),
h->root.root.string); h->root.root.string);
} }
@ -6510,8 +6511,8 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
if (h->size == 0) if (h->size == 0)
{ {
(*_bfd_error_handler) (_("dynamic variable `%s' is zero size"), info->callbacks->einfo (_("dynamic variable `%s' is zero size\n"),
h->root.root.string); h->root.root.string);
return TRUE; return TRUE;
} }
@ -6928,8 +6929,8 @@ dec_dynrel_count (bfd_vma r_info,
pp = &p->next; pp = &p->next;
} }
(*_bfd_error_handler) (_("dynreloc miscount for %B, section %A"), info->callbacks->einfo (_("dynreloc miscount for %B, section %A\n"),
sec->owner, sec); sec->owner, sec);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -7600,7 +7601,7 @@ ppc64_elf_tls_optimize (struct bfd_link_info *info)
&& !found_tls_get_addr_arg && !found_tls_get_addr_arg
&& is_branch_reloc (r_type)) && is_branch_reloc (r_type))
{ {
info->callbacks->minfo (_("%C __tls_get_addr lost arg, " info->callbacks->minfo (_("%H __tls_get_addr lost arg, "
"TLS optimization disabled\n"), "TLS optimization disabled\n"),
ibfd, sec, rel->r_offset); ibfd, sec, rel->r_offset);
ret = TRUE; ret = TRUE;
@ -7794,7 +7795,7 @@ ppc64_elf_tls_optimize (struct bfd_link_info *info)
could just mark this symbol to exclude it could just mark this symbol to exclude it
from tls optimization but it's safer to skip from tls optimization but it's safer to skip
the entire optimization. */ the entire optimization. */
info->callbacks->minfo (_("%C arg lost __tls_get_addr, " info->callbacks->minfo (_("%H arg lost __tls_get_addr, "
"TLS optimization disabled\n"), "TLS optimization disabled\n"),
ibfd, sec, rel->r_offset); ibfd, sec, rel->r_offset);
ret = TRUE; ret = TRUE;
@ -9473,9 +9474,10 @@ get_relocs (asection *sec, int count)
} }
static bfd_vma static bfd_vma
get_r2off (struct ppc_link_hash_table *htab, get_r2off (struct bfd_link_info *info,
struct ppc_stub_hash_entry *stub_entry) struct ppc_stub_hash_entry *stub_entry)
{ {
struct ppc_link_hash_table *htab = ppc_hash_table (info);
bfd_vma r2off = htab->stub_group[stub_entry->target_section->id].toc_off; bfd_vma r2off = htab->stub_group[stub_entry->target_section->id].toc_off;
if (r2off == 0) if (r2off == 0)
@ -9489,15 +9491,15 @@ get_r2off (struct ppc_link_hash_table *htab,
if (strcmp (opd->name, ".opd") != 0 if (strcmp (opd->name, ".opd") != 0
|| opd->reloc_count != 0) || opd->reloc_count != 0)
{ {
(*_bfd_error_handler) (_("cannot find opd entry toc for %s"), info->callbacks->einfo (_("cannot find opd entry toc for %s\n"),
stub_entry->h->elf.root.root.string); stub_entry->h->elf.root.root.string);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return 0; return 0;
} }
if (!bfd_get_section_contents (opd->owner, opd, buf, opd_off + 8, 8)) if (!bfd_get_section_contents (opd->owner, opd, buf, opd_off + 8, 8))
return 0; return 0;
r2off = bfd_get_64 (opd->owner, buf); r2off = bfd_get_64 (opd->owner, buf);
r2off -= elf_gp (stub_entry->id_sec->output_section->owner); r2off -= elf_gp (info->output_bfd);
} }
r2off -= htab->stub_group[stub_entry->id_sec->id].toc_off; r2off -= htab->stub_group[stub_entry->id_sec->id].toc_off;
return r2off; return r2off;
@ -9547,7 +9549,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
size = 4; size = 4;
if (stub_entry->stub_type == ppc_stub_long_branch_r2off) if (stub_entry->stub_type == ppc_stub_long_branch_r2off)
{ {
bfd_vma r2off = get_r2off (htab, stub_entry); bfd_vma r2off = get_r2off (info, stub_entry);
if (r2off == 0) if (r2off == 0)
{ {
@ -9571,8 +9573,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (off + (1 << 25) >= (bfd_vma) (1 << 26)) if (off + (1 << 25) >= (bfd_vma) (1 << 26))
{ {
(*_bfd_error_handler) (_("long branch stub `%s' offset overflow"), info->callbacks->einfo (_("long branch stub `%s' offset overflow\n"),
stub_entry->root.string); stub_entry->root.string);
htab->stub_error = TRUE; htab->stub_error = TRUE;
return FALSE; return FALSE;
} }
@ -9630,8 +9632,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
FALSE, FALSE); FALSE, FALSE);
if (br_entry == NULL) if (br_entry == NULL)
{ {
(*_bfd_error_handler) (_("can't find branch stub `%s'"), info->callbacks->einfo (_("can't find branch stub `%s'\n"),
stub_entry->root.string); stub_entry->root.string);
htab->stub_error = TRUE; htab->stub_error = TRUE;
return FALSE; return FALSE;
} }
@ -9691,8 +9693,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) if (off + 0x80008000 > 0xffffffff || (off & 7) != 0)
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("linkage table error against `%s'"), (_("linkage table error against `%s'\n"),
stub_entry->root.string); stub_entry->root.string);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
htab->stub_error = TRUE; htab->stub_error = TRUE;
@ -9737,7 +9739,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
} }
else else
{ {
bfd_vma r2off = get_r2off (htab, stub_entry); bfd_vma r2off = get_r2off (info, stub_entry);
if (r2off == 0) if (r2off == 0)
{ {
@ -9833,8 +9835,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) if (off + 0x80008000 > 0xffffffff || (off & 7) != 0)
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("linkage table error against `%s'"), (_("linkage table error against `%s'\n"),
stub_entry->h != NULL stub_entry->h != NULL
? stub_entry->h->elf.root.root.string ? stub_entry->h->elf.root.root.string
: "<local sym>"); : "<local sym>");
@ -9986,7 +9988,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
size = 4; size = 4;
if (stub_entry->stub_type == ppc_stub_long_branch_r2off) if (stub_entry->stub_type == ppc_stub_long_branch_r2off)
{ {
r2off = get_r2off (htab, stub_entry); r2off = get_r2off (info, stub_entry);
if (r2off == 0) if (r2off == 0)
{ {
htab->stub_error = TRUE; htab->stub_error = TRUE;
@ -10008,8 +10010,8 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
TRUE, FALSE); TRUE, FALSE);
if (br_entry == NULL) if (br_entry == NULL)
{ {
(*_bfd_error_handler) (_("can't build branch stub `%s'"), info->callbacks->einfo (_("can't build branch stub `%s'\n"),
stub_entry->root.string); stub_entry->root.string);
htab->stub_error = TRUE; htab->stub_error = TRUE;
return FALSE; return FALSE;
} }
@ -11151,7 +11153,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size)
continue; continue;
} }
stub_entry = ppc_add_stub (stub_name, section, htab); stub_entry = ppc_add_stub (stub_name, section, info);
if (stub_entry == NULL) if (stub_entry == NULL)
{ {
free (stub_name); free (stub_name);
@ -11472,7 +11474,7 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
|| htab->glink->rawsize != htab->glink->size) || htab->glink->rawsize != htab->glink->size)
{ {
htab->stub_error = TRUE; htab->stub_error = TRUE;
(*_bfd_error_handler) (_("stubs don't match calculated size")); info->callbacks->einfo (_("stubs don't match calculated size\n"));
} }
if (htab->stub_error) if (htab->stub_error)
@ -11832,13 +11834,11 @@ ppc64_elf_relocate_section (bfd *output_bfd,
/* R_PPC64_TLS is OK against a symbol in the TOC. */ /* R_PPC64_TLS is OK against a symbol in the TOC. */
; ;
else else
(*_bfd_error_handler) info->callbacks->einfo
(!IS_PPC64_TLS_RELOC (r_type) (!IS_PPC64_TLS_RELOC (r_type)
? _("%B(%A+0x%lx): %s used with TLS symbol %s") ? _("%H: %s used with TLS symbol %s\n")
: _("%B(%A+0x%lx): %s used with non-TLS symbol %s"), : _("%H: %s used with non-TLS symbol %s\n"),
input_bfd, input_bfd, input_section, rel->r_offset,
input_section,
(long) rel->r_offset,
ppc64_elf_howto_table[r_type]->name, ppc64_elf_howto_table[r_type]->name,
sym_name); sym_name);
} }
@ -12334,23 +12334,19 @@ ppc64_elf_relocate_section (bfd *output_bfd,
".init") == 0 ".init") == 0
|| strcmp (input_section->output_section->name, || strcmp (input_section->output_section->name,
".fini") == 0) ".fini") == 0)
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): automatic multiple TOCs " (_("%H: automatic multiple TOCs "
"not supported using your crt files; " "not supported using your crt files; "
"recompile with -mminimal-toc or upgrade gcc"), "recompile with -mminimal-toc or upgrade gcc\n"),
input_bfd, input_bfd, input_section, rel->r_offset);
input_section,
(long) rel->r_offset);
else else
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): sibling call optimization to `%s' " (_("%H: sibling call optimization to `%s' "
"does not allow automatic multiple TOCs; " "does not allow automatic multiple TOCs; "
"recompile with -mminimal-toc or " "recompile with -mminimal-toc or "
"-fno-optimize-sibling-calls, " "-fno-optimize-sibling-calls, "
"or make `%s' extern"), "or make `%s' extern\n"),
input_bfd, input_bfd, input_section, rel->r_offset,
input_section,
(long) rel->r_offset,
sym_name, sym_name,
sym_name); sym_name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -12451,8 +12447,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
switch (r_type) switch (r_type)
{ {
default: default:
(*_bfd_error_handler) info->callbacks->einfo
(_("%B: unknown relocation type %d for symbol %s"), (_("%B: unknown relocation type %d for symbol %s\n"),
input_bfd, (int) r_type, sym_name); input_bfd, (int) r_type, sym_name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -12956,12 +12952,10 @@ ppc64_elf_relocate_section (bfd *output_bfd,
? h->elf.type == STT_GNU_IFUNC ? h->elf.type == STT_GNU_IFUNC
: ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) : ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): relocation %s for indirect " (_("%H: relocation %s for indirect "
"function %s unsupported"), "function %s unsupported\n"),
input_bfd, input_bfd, input_section, rel->r_offset,
input_section,
(long) rel->r_offset,
ppc64_elf_howto_table[r_type]->name, ppc64_elf_howto_table[r_type]->name,
sym_name); sym_name);
ret = FALSE; ret = FALSE;
@ -13063,8 +13057,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
case R_PPC64_PLTREL64: case R_PPC64_PLTREL64:
/* These ones haven't been implemented yet. */ /* These ones haven't been implemented yet. */
(*_bfd_error_handler) info->callbacks->einfo
(_("%B: relocation %s is not supported for symbol %s."), (_("%B: relocation %s is not supported for symbol %s\n"),
input_bfd, input_bfd,
ppc64_elf_howto_table[r_type]->name, sym_name); ppc64_elf_howto_table[r_type]->name, sym_name);
@ -13240,9 +13234,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
mask = 15; mask = 15;
if (((relocation + addend) & mask) != 0) if (((relocation + addend) & mask) != 0)
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): error: %s not a multiple of %u"), (_("%H: error: %s not a multiple of %u\n"),
input_bfd, input_section, (long) rel->r_offset, input_bfd, input_section, rel->r_offset,
ppc64_elf_howto_table[r_type]->name, ppc64_elf_howto_table[r_type]->name,
mask + 1); mask + 1);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -13259,11 +13253,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
&& !((input_section->flags & SEC_DEBUGGING) != 0 && !((input_section->flags & SEC_DEBUGGING) != 0
&& h->elf.def_dynamic)) && h->elf.def_dynamic))
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), (_("%H: unresolvable %s relocation against symbol `%s'\n"),
input_bfd, input_bfd, input_section, rel->r_offset,
input_section,
(long) rel->r_offset,
ppc64_elf_howto_table[(int) r_type]->name, ppc64_elf_howto_table[(int) r_type]->name,
h->elf.root.root.string); h->elf.root.root.string);
ret = FALSE; ret = FALSE;
@ -13306,11 +13298,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
} }
else else
{ {
(*_bfd_error_handler) info->callbacks->einfo
(_("%B(%A+0x%lx): %s reloc against `%s': error %d"), (_("%H: %s reloc against `%s': error %d\n"),
input_bfd, input_bfd, input_section, rel->r_offset,
input_section,
(long) rel->r_offset,
ppc64_elf_howto_table[r_type]->name, ppc64_elf_howto_table[r_type]->name,
sym_name, sym_name,
(int) r); (int) r);