aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-02-20 19:29:09 +1030
committerAlan Modra <amodra@gmail.com>2018-02-26 09:27:36 +1030
commitcf97bcb0c3f33460e9cfa57a2890df1c38a497d7 (patch)
tree21cd4941fd6388254e721a1e9a551f136be627cf /bfd/elf64-ppc.c
parentFix double space expected in cp_test_ptype_class (diff)
downloadbinutils-gdb-cf97bcb0c3f33460e9cfa57a2890df1c38a497d7.tar.gz
binutils-gdb-cf97bcb0c3f33460e9cfa57a2890df1c38a497d7.tar.bz2
binutils-gdb-cf97bcb0c3f33460e9cfa57a2890df1c38a497d7.zip
PPC error/warning messages
The GNU coding standard says error messages should be of the form program:sourcefile:lineno: message or program: message and "The string message should not begin with a capital letter when it follows a program name and/or file name, because that isn’t the beginning of a sentence. (The sentence conceptually starts at the beginning of the line.) Also, it should not end with a period." This patch does that for ppc, and removes some British spelling. I've also switched some error output from using the linker callback einfo to _bfd_error_handler, due to improved compilation time argument checking now done for the latter function. bfd/ * elf32-ppc.c: Standardize error/warning messages. Use _bfd_error_handler rather than einfo when einfo features not used. * elf64-ppc.c: Likewise. ld/ * testsuite/ld-powerpc/attr-gnu-12-21.d: Update. * testsuite/ld-powerpc/attr-gnu-4-12.d: Update. * testsuite/ld-powerpc/attr-gnu-4-13.d: Update. * testsuite/ld-powerpc/attr-gnu-4-21.d: Update. * testsuite/ld-powerpc/attr-gnu-4-23.d: Update. * testsuite/ld-powerpc/attr-gnu-4-31.d: Update. * testsuite/ld-powerpc/attr-gnu-4-32.d: Update. * testsuite/ld-powerpc/attr-gnu-8-23.d: Update.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index f8b6629d2d9..cebd7e2278b 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -2514,8 +2514,8 @@ ppc64_elf_info_to_howto (bfd *abfd, arelent *cache_ptr,
if (type >= ARRAY_SIZE (ppc64_elf_howto_table))
{
/* xgettext:c-format */
- _bfd_error_handler (_("%pB: invalid relocation type %d"),
- abfd, (int) type);
+ _bfd_error_handler (_("%pB: unsupported reloc type %#x"),
+ abfd, type);
type = R_PPC64_NONE;
}
cache_ptr->howto = ppc64_elf_howto_table[type];
@@ -4647,8 +4647,8 @@ ppc_add_stub (const char *stub_name,
if (stub_entry == NULL)
{
/* xgettext:c-format */
- info->callbacks->einfo (_("%P: %pB: cannot create stub entry %s\n"),
- section->owner, stub_name);
+ _bfd_error_handler (_("%pB: cannot create stub entry %s"),
+ section->owner, stub_name);
return NULL;
}
@@ -4978,8 +4978,8 @@ ppc64_elf_add_symbol_hook (bfd *ibfd,
set_abiversion (ibfd, 2);
else if (abiversion (ibfd) == 1)
{
- info->callbacks->einfo (_("%P: symbol '%s' has invalid st_other"
- " for ABI version 1\n"), name);
+ _bfd_error_handler (_("symbol '%s' has invalid st_other"
+ " for ABI version 1"), *name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
@@ -5153,9 +5153,8 @@ ppc64_elf_before_check_relocs (bfd *ibfd, struct bfd_link_info *info)
else if (abiversion (ibfd) >= 2)
{
/* xgettext:c-format */
- info->callbacks->einfo (_("%P: %pB .opd not allowed in ABI"
- " version %d\n"),
- ibfd, abiversion (ibfd));
+ _bfd_error_handler (_("%pB .opd not allowed in ABI version %d"),
+ ibfd, abiversion (ibfd));
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
@@ -5653,7 +5652,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
ppc_howto_init ();
/* xgettext:c-format */
info->callbacks->einfo (_("%H: %s reloc unsupported "
- "in shared libraries and PIEs.\n"),
+ "in shared libraries and PIEs\n"),
abfd, sec, rel->r_offset,
ppc64_elf_howto_table[r_type]->name);
bfd_set_error (bfd_error_bad_value);
@@ -7756,8 +7755,8 @@ dec_dynrel_count (bfd_vma r_info,
}
/* xgettext:c-format */
- info->callbacks->einfo (_("%P: dynreloc miscount for %pB, section %pA\n"),
- sec->owner, sec);
+ _bfd_error_handler (_("dynreloc miscount for %pB, section %pA"),
+ sec->owner, sec);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
@@ -8213,9 +8212,9 @@ ppc64_elf_tls_setup (struct bfd_link_info *info)
if (htab->params->plt_localentry0
&& elf_link_hash_lookup (&htab->elf, "GLIBC_2.26",
FALSE, FALSE, FALSE) == NULL)
- info->callbacks->einfo
- (_("%P: warning: --plt-localentry is especially dangerous without "
- "ld.so support to detect ABI violations.\n"));
+ _bfd_error_handler
+ (_("warning: --plt-localentry is especially dangerous without "
+ "ld.so support to detect ABI violations"));
htab->tls_get_addr = ((struct ppc_link_hash_entry *)
elf_link_hash_lookup (&htab->elf, ".__tls_get_addr",
@@ -9173,7 +9172,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
info->callbacks->einfo
/* xgettext:c-format */
(_("%H: toc optimization is not supported for"
- " %s instruction.\n"),
+ " %s instruction\n"),
ibfd, sec, rel->r_offset & ~3, str);
}
}
@@ -10867,8 +10866,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (off + (1 << 25) >= (bfd_vma) (1 << 26))
{
- info->callbacks->einfo
- (_("%P: long branch stub `%s' offset overflow\n"),
+ _bfd_error_handler
+ (_("long branch stub `%s' offset overflow"),
stub_entry->root.string);
htab->stub_error = TRUE;
return FALSE;
@@ -10927,8 +10926,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
FALSE, FALSE);
if (br_entry == NULL)
{
- info->callbacks->einfo (_("%P: can't find branch stub `%s'\n"),
- stub_entry->root.string);
+ _bfd_error_handler (_("can't find branch stub `%s'"),
+ stub_entry->root.string);
htab->stub_error = TRUE;
return FALSE;
}
@@ -11355,8 +11354,8 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
TRUE, FALSE);
if (br_entry == NULL)
{
- info->callbacks->einfo (_("%P: can't build branch stub `%s'\n"),
- stub_entry->root.string);
+ _bfd_error_handler (_("can't build branch stub `%s'"),
+ stub_entry->root.string);
htab->stub_error = TRUE;
return FALSE;
}
@@ -13271,7 +13270,7 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
if (group != NULL)
{
htab->stub_error = TRUE;
- info->callbacks->einfo (_("%P: stubs don't match calculated size\n"));
+ _bfd_error_handler (_("stubs don't match calculated size"));
}
if (htab->stub_error)
@@ -14352,10 +14351,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
switch (r_type)
{
default:
- info->callbacks->einfo
- /* xgettext:c-format */
- (_("%P: %pB: unknown relocation type %d for `%pT'\n"),
- input_bfd, (int) r_type, sym_name);
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%pB: %s unsupported"),
+ input_bfd, ppc64_elf_howto_table[r_type]->name);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
@@ -15711,8 +15709,8 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
+ (p + 8 - htab->glink_eh_frame->contents));
if (val + 0x80000000 > 0xffffffff)
{
- info->callbacks->einfo
- (_("%P: %s offset too large for .eh_frame sdata4 encoding"),
+ _bfd_error_handler
+ (_("%s offset too large for .eh_frame sdata4 encoding"),
group->stub_sec->name);
return FALSE;
}
@@ -15730,8 +15728,8 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
+ (p + 8 - htab->glink_eh_frame->contents));
if (val + 0x80000000 > 0xffffffff)
{
- info->callbacks->einfo
- (_("%P: %s offset too large for .eh_frame sdata4 encoding"),
+ _bfd_error_handler
+ (_("%s offset too large for .eh_frame sdata4 encoding"),
htab->glink->name);
return FALSE;
}