Add misalignment warning. 2015-10-16 Andrew Stubbs bfd/ * elf64-ppc.c (ppc64_elf_set_toc): Warn about misaligned sections. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index e5344df..1bcde43 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -12615,6 +12615,7 @@ ppc64_elf_set_toc (struct bfd_link_info *info, bfd *obfd) { asection *s; bfd_vma TOCstart, adjust; + static bfd_boolean warned = FALSE; if (info != NULL) { @@ -12695,6 +12696,14 @@ ppc64_elf_set_toc (struct bfd_link_info *info, bfd *obfd) TOCstart -= adjust; _bfd_set_gp_value (obfd, TOCstart); + if (!warned && adjust != 0) + { + info->callbacks->einfo + (_("%B: warning: section `%A' not %d-byte aligned in linker script\n"), + obfd, s, TOC_BASE_ALIGN); + warned = TRUE; + } + if (info != NULL && s != NULL) { struct ppc_link_hash_table *htab = ppc_hash_table (info);