error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] --- a/bfd.orig/elf64-ppc.c 2010-07-01 04:48:26.000000000 -0500 +++ b/bfd/elf64-ppc.c 2019-08-23 03:05:25.000000000 -0500 @@ -4609,7 +4609,7 @@ len = strlen (name); dot_name = bfd_alloc (abfd, len + 2); if (dot_name == NULL) - return (struct elf_link_hash_entry *) 0 - 1; + return (struct elf_link_hash_entry *)-1L; dot_name[0] = '.'; memcpy (dot_name + 1, name, len + 1); h = _bfd_elf_archive_symbol_lookup (abfd, info, dot_name); --- a/bfd.orig/elflink.c 2010-04-14 03:29:33.000000000 -0500 +++ b/bfd/elflink.c 2019-08-23 03:04:48.000000000 -0500 @@ -4916,7 +4916,7 @@ len = strlen (name); copy = (char *) bfd_alloc (abfd, len); if (copy == NULL) - return (struct elf_link_hash_entry *) 0 - 1; + return (struct elf_link_hash_entry *)-1L; first = p - name + 1; memcpy (copy, name, first); @@ -5028,7 +5028,7 @@ } h = archive_symbol_lookup (abfd, info, symdef->name); - if (h == (struct elf_link_hash_entry *) 0 - 1) + if (h == (struct elf_link_hash_entry *)-1L) goto error_return; if (h == NULL)