From: Maciej W. Rozycki Date: Wed, 14 Jan 2026 22:28:44 +0000 (+0000) Subject: MIPS/BFD: Standardize orphan REL HI16 relocation warning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f467fba80cea49a1941a24b1716a5e9c82fa77c;p=thirdparty%2Fbinutils-gdb.git MIPS/BFD: Standardize orphan REL HI16 relocation warning Use the warning callback for the orphan REL HI16 relocation warning just as with any other linker relocation processing warnings, standardizing the message format and providing source location where available. Test cases will be added with a separate change. --- diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 34f58c311c1..f4424aca504 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -10605,12 +10605,18 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, name = bfd_elf_sym_name (input_bfd, symtab_hdr, local_syms + r_symndx, sec); - _bfd_error_handler - /* xgettext:c-format */ - (_("%pB: can't find matching LO16 reloc against `%s'" - " for %s at %#" PRIx64 " in section `%pA'"), - input_bfd, name, - howto->name, (uint64_t) rel->r_offset, input_section); + /* xgettext:c-format */ + msg = bfd_asprintf (_("can't find matching LO16 reloc" + " against `%s' for %s at %#" PRIx64 + " in section `%s'"), + name, howto->name, + (uint64_t) rel->r_offset, + input_section->name); + if (msg == NULL) + return false; + info->callbacks->warning + (info, msg, name, input_bfd, input_section, + rel->r_offset); } } else