{
bfd_byte buf[4];
- BFD_ASSERT (hdr->sh_size == sizeof (Elf32_External_RegInfo));
BFD_ASSERT (hdr->contents == NULL);
+ if (hdr->sh_size != sizeof (Elf32_External_RegInfo))
+ {
+ _bfd_error_handler
+ (_("%pB: Incorrect `.reginfo' section size; "
+ "expected %" PRIu64 ", got %" PRIu64),
+ abfd, (uint64_t) sizeof (Elf32_External_RegInfo),
+ (uint64_t) hdr->sh_size);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
if (bfd_seek (abfd,
hdr->sh_offset + sizeof (Elf32_External_RegInfo) - 4,
SEEK_SET) != 0)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: Warning: bad `%s' option size %u smaller than"
+ (_("%pB: Warning: bad `%s' option size %u smaller than"
" its header"),
abfd, MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size);
break;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: Warning: bad `%s' option size %u smaller than"
+ (_("%pB: Warning: bad `%s' option size %u smaller than"
" its header"),
abfd, MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size);
break;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: Warning: cannot determine the target function for"
+ (_("%pB: Warning: cannot determine the target function for"
" stub section `%s'"),
abfd, name);
bfd_set_error (bfd_error_bad_value);
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: Warning: cannot determine the target function for"
+ (_("%pB: Warning: cannot determine the target function for"
" stub section `%s'"),
abfd, name);
bfd_set_error (bfd_error_bad_value);
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: Malformed reloc detected for section %s"),
+ (_("%pB: Malformed reloc detected for section %s"),
abfd, name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: GOT reloc at %#Lx not expected in executables"),
- abfd, rel->r_offset);
+ (_("%pB: GOT reloc at %#" PRIx64 " not expected in executables"),
+ abfd, (uint64_t) rel->r_offset);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: CALL16 reloc at %#Lx not against global symbol"),
- abfd, rel->r_offset);
+ (_("%pB: CALL16 reloc at %#" PRIx64 " not against global symbol"),
+ abfd, (uint64_t) rel->r_offset);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
howto = MIPS_ELF_RTYPE_TO_HOWTO (abfd, r_type, FALSE);
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: relocation %s against `%s' can not be used"
+ (_("%pB: relocation %s against `%s' can not be used"
" when making a shared object; recompile with -fPIC"),
abfd, howto->name,
(h) ? h->root.root.string : "a local symbol");
sec);
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: Can't find matching LO16 reloc against `%s'"
- " for %s at %#Lx in section `%A'"),
+ (_("%pB: Can't find matching LO16 reloc against `%s'"
+ " for %s at %#" PRIx64 " in section `%pA'"),
input_bfd, name,
- howto->name, rel->r_offset, input_section);
+ howto->name, (uint64_t) rel->r_offset, input_section);
}
}
else
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: `%A' offset of %Ld from `%A' "
+ (_("%pB: `%pA' offset of %" PRId64 " from `%pA' "
"beyond the range of ADDIUPC"),
output_bfd,
htab->root.sgotplt->output_section,
- gotpc_offset,
+ (int64_t) gotpc_offset,
htab->root.splt->output_section);
bfd_set_error (bfd_error_no_error);
return FALSE;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: `%A' offset of %Ld from `%A' beyond the range of ADDIUPC"),
+ (_("%pB: `%pA' offset of %" PRId64 " from `%pA' "
+ "beyond the range of ADDIUPC"),
output_bfd,
htab->root.sgotplt->output_section,
- gotpc_offset,
+ (int64_t) gotpc_offset,
htab->root.splt->output_section);
bfd_set_error (bfd_error_no_error);
return FALSE;
line_ptr, discriminator_ptr,
dwarf_debug_sections,
ABI_64_P (abfd) ? 8 : 0,
- &elf_tdata (abfd)->dwarf2_find_line_info))
- return TRUE;
+ &elf_tdata (abfd)->dwarf2_find_line_info)
+ || _bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset,
+ filename_ptr, functionname_ptr,
+ line_ptr))
+ {
+ /* PR 22789: If the function name or filename was not found through
+ the debug information, then try an ordinary lookup instead. */
+ if ((functionname_ptr != NULL && *functionname_ptr == NULL)
+ || (filename_ptr != NULL && *filename_ptr == NULL))
+ {
+ /* Do not override already discovered names. */
+ if (functionname_ptr != NULL && *functionname_ptr != NULL)
+ functionname_ptr = NULL;
- if (_bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset,
- filename_ptr, functionname_ptr,
- line_ptr))
- return TRUE;
+ if (filename_ptr != NULL && *filename_ptr != NULL)
+ filename_ptr = NULL;
+
+ _bfd_elf_find_function (abfd, symbols, section, offset,
+ filename_ptr, functionname_ptr);
+ }
+
+ return TRUE;
+ }
msec = bfd_get_section_by_name (abfd, ".mdebug");
if (msec != NULL)
default:
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: Unknown architecture %s"),
+ (_("%pB: Unknown architecture %s"),
abfd, bfd_printable_name (abfd));
}
if (o->size != sizeof (Elf32_External_RegInfo))
{
_bfd_error_handler
- (_("%B: .reginfo section size should be %d bytes, "
- "actual size is %d"),
- abfd, sizeof (Elf32_External_RegInfo), o->size);
+ (_("%pB: .reginfo section size should be %ld bytes, "
+ "actual size is %" PRId64),
+ abfd, (unsigned long) sizeof (Elf32_External_RegInfo),
+ (int64_t) o->size);
return FALSE;
}
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: illegal section name `%A'"), abfd, o);
+ (_("%pB: illegal section name `%pA'"), abfd, o);
bfd_set_error (bfd_error_nonrepresentable_section);
return FALSE;
}
!= ((old_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0))
{
_bfd_error_handler
- (_("%B: warning: linking abicalls files with non-abicalls files"),
+ (_("%pB: warning: linking abicalls files with non-abicalls files"),
ibfd);
ok = TRUE;
}
if (mips_32bit_flags_p (old_flags) != mips_32bit_flags_p (new_flags))
{
_bfd_error_handler
- (_("%B: linking 32-bit code with 64-bit code"),
+ (_("%pB: linking 32-bit code with 64-bit code"),
ibfd);
ok = FALSE;
}
/* The ISAs aren't compatible. */
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: linking %s module with previous %s modules"),
+ (_("%pB: linking %s module with previous %s modules"),
ibfd,
bfd_printable_name (ibfd),
bfd_printable_name (obfd));
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: ABI mismatch: linking %s module with previous %s modules"),
+ (_("%pB: ABI mismatch: linking %s module with previous %s modules"),
ibfd,
elf_mips_abi_name (ibfd),
elf_mips_abi_name (obfd));
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: ASE mismatch: linking %s module with previous %s modules"),
+ (_("%pB: ASE mismatch: linking %s module with previous %s modules"),
ibfd,
m16_mis ? "MIPS16" : "microMIPS",
m16_mis ? "microMIPS" : "MIPS16");
if ((new_flags & EF_MIPS_NAN2008) != (old_flags & EF_MIPS_NAN2008))
{
/* xgettext:c-format */
- _bfd_error_handler (_("%B: linking %s module with previous %s modules"),
+ _bfd_error_handler (_("%pB: linking %s module with previous %s modules"),
ibfd,
(new_flags & EF_MIPS_NAN2008
? "-mnan=2008" : "-mnan=legacy"),
if ((new_flags & EF_MIPS_FP64) != (old_flags & EF_MIPS_FP64))
{
/* xgettext:c-format */
- _bfd_error_handler (_("%B: linking %s module with previous %s modules"),
+ _bfd_error_handler (_("%pB: linking %s module with previous %s modules"),
ibfd,
(new_flags & EF_MIPS_FP64
? "-mfp64" : "-mfp32"),
{
/* xgettext:c-format */
_bfd_error_handler
- (_("%B: uses different e_flags (%#x) fields than previous modules "
+ (_("%pB: uses different e_flags (%#x) fields than previous modules "
"(%#x)"),
ibfd, new_flags, old_flags);
ok = FALSE;
if (!out_string && !in_string)
/* xgettext:c-format */
_bfd_error_handler
- (_("Warning: %B uses unknown floating point ABI %d "
- "(set by %B), %B uses unknown floating point ABI %d"),
+ (_("Warning: %pB uses unknown floating point ABI %d "
+ "(set by %pB), %pB uses unknown floating point ABI %d"),
obfd, out_fp, abi_fp_bfd, ibfd, in_fp);
else if (!out_string)
_bfd_error_handler
/* xgettext:c-format */
- (_("Warning: %B uses unknown floating point ABI %d "
- "(set by %B), %B uses %s"),
+ (_("Warning: %pB uses unknown floating point ABI %d "
+ "(set by %pB), %pB uses %s"),
obfd, out_fp, abi_fp_bfd, ibfd, in_string);
else if (!in_string)
_bfd_error_handler
/* xgettext:c-format */
- (_("Warning: %B uses %s (set by %B), "
- "%B uses unknown floating point ABI %d"),
+ (_("Warning: %pB uses %s (set by %pB), "
+ "%pB uses unknown floating point ABI %d"),
obfd, out_string, abi_fp_bfd, ibfd, in_fp);
else
{
in_string = "-mhard-float";
_bfd_error_handler
/* xgettext:c-format */
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
+ (_("Warning: %pB uses %s (set by %pB), %pB uses %s"),
obfd, out_string, abi_fp_bfd, ibfd, in_string);
}
}
case Val_GNU_MIPS_ABI_MSA_128:
_bfd_error_handler
/* xgettext:c-format */
- (_("Warning: %B uses %s (set by %B), "
- "%B uses unknown MSA ABI %d"),
+ (_("Warning: %pB uses %s (set by %pB), "
+ "%pB uses unknown MSA ABI %d"),
obfd, "-mmsa", abi_msa_bfd,
ibfd, in_attr[Tag_GNU_MIPS_ABI_MSA].i);
break;
case Val_GNU_MIPS_ABI_MSA_128:
_bfd_error_handler
/* xgettext:c-format */
- (_("Warning: %B uses unknown MSA ABI %d "
- "(set by %B), %B uses %s"),
+ (_("Warning: %pB uses unknown MSA ABI %d "
+ "(set by %pB), %pB uses %s"),
obfd, out_attr[Tag_GNU_MIPS_ABI_MSA].i,
abi_msa_bfd, ibfd, "-mmsa");
break;
default:
_bfd_error_handler
/* xgettext:c-format */
- (_("Warning: %B uses unknown MSA ABI %d "
- "(set by %B), %B uses unknown MSA ABI %d"),
+ (_("Warning: %pB uses unknown MSA ABI %d "
+ "(set by %pB), %pB uses unknown MSA ABI %d"),
obfd, out_attr[Tag_GNU_MIPS_ABI_MSA].i,
abi_msa_bfd, ibfd, in_attr[Tag_GNU_MIPS_ABI_MSA].i);
break;
if (! _bfd_generic_verify_endian_match (ibfd, info))
{
_bfd_error_handler
- (_("%B: endianness incompatible with that of the selected emulation"),
+ (_("%pB: endianness incompatible with that of the selected emulation"),
ibfd);
return FALSE;
}
if (strcmp (bfd_get_target (ibfd), bfd_get_target (obfd)) != 0)
{
_bfd_error_handler
- (_("%B: ABI is incompatible with that of the selected emulation"),
+ (_("%pB: ABI is incompatible with that of the selected emulation"),
ibfd);
return FALSE;
}
if (LEVEL_REV (in_abiflags.isa_level, in_abiflags.isa_rev)
< LEVEL_REV (abiflags.isa_level, abiflags.isa_rev))
_bfd_error_handler
- (_("%B: warning: Inconsistent ISA between e_flags and "
+ (_("%pB: warning: Inconsistent ISA between e_flags and "
".MIPS.abiflags"), ibfd);
if (abiflags.fp_abi != Val_GNU_MIPS_ABI_FP_ANY
&& in_abiflags.fp_abi != abiflags.fp_abi)
_bfd_error_handler
- (_("%B: warning: Inconsistent FP ABI between .gnu.attributes and "
+ (_("%pB: warning: Inconsistent FP ABI between .gnu.attributes and "
".MIPS.abiflags"), ibfd);
if ((in_abiflags.ases & abiflags.ases) != abiflags.ases)
_bfd_error_handler
- (_("%B: warning: Inconsistent ASEs between e_flags and "
+ (_("%pB: warning: Inconsistent ASEs between e_flags and "
".MIPS.abiflags"), ibfd);
/* The isa_ext is allowed to be an extension of what can be inferred
from e_flags. */
if (!mips_mach_extends_p (bfd_mips_isa_ext_mach (abiflags.isa_ext),
bfd_mips_isa_ext_mach (in_abiflags.isa_ext)))
_bfd_error_handler
- (_("%B: warning: Inconsistent ISA extensions between e_flags and "
+ (_("%pB: warning: Inconsistent ISA extensions between e_flags and "
".MIPS.abiflags"), ibfd);
if (in_abiflags.flags2 != 0)
_bfd_error_handler
- (_("%B: warning: Unexpected flag in the flags2 field of "
+ (_("%pB: warning: Unexpected flag in the flags2 field of "
".MIPS.abiflags (0x%lx)"), ibfd,
in_abiflags.flags2);
}