_bfd_elf_add_dynamic_entry (info, tag, val)
#define MIPS_ELF_RTYPE_TO_HOWTO(abfd, rtype, rela) \
- (get_elf_backend_data (abfd)->elf_backend_mips_rtype_to_howto (rtype, rela))
+ (get_elf_backend_data (abfd)->elf_backend_mips_rtype_to_howto (abfd, rtype, rela))
/* The name of the dynamic relocation section. */
#define MIPS_ELF_REL_DYN_NAME(INFO) \
}
else
{
+ bfd_boolean reject_undefined
+ = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
+ || ELF_ST_VISIBILITY (h->root.other) != STV_DEFAULT);
+
(*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
- input_section, relocation->r_offset,
- (info->unresolved_syms_in_objects == RM_GENERATE_ERROR)
- || ELF_ST_VISIBILITY (h->root.other));
- return bfd_reloc_undefined;
+ input_section, relocation->r_offset, reject_undefined);
+
+ if (reject_undefined)
+ return bfd_reloc_undefined;
+
+ symbol = 0;
}
target_is_16_bit_code_p = ELF_ST_IS_MIPS16 (h->root.other);
: opcode == 0x1d)
{
info->callbacks->einfo
- (_("%X%H: Unsupported JALX to the same ISA mode\n"),
+ (_("%X%H: unsupported JALX to the same ISA mode\n"),
input_bfd, input_section, relocation->r_offset);
return TRUE;
}
if (!ok)
{
info->callbacks->einfo
- (_("%X%H: Unsupported jump between ISA modes; "
+ (_("%X%H: unsupported jump between ISA modes; "
"consider recompiling with interlinking enabled\n"),
input_bfd, input_section, relocation->r_offset);
return TRUE;
if ((addr >> 28) << 28 != (dest >> 28) << 28)
{
info->callbacks->einfo
- (_("%X%H: Cannot convert branch between ISA modes "
+ (_("%X%H: cannot convert branch between ISA modes "
"to JALX: relocation out of range\n"),
input_bfd, input_section, relocation->r_offset);
return TRUE;
else if (!mips_elf_hash_table (info)->ignore_branch_isa)
{
info->callbacks->einfo
- (_("%X%H: Unsupported branch between ISA modes\n"),
+ (_("%X%H: unsupported branch between ISA modes\n"),
input_bfd, input_section, relocation->r_offset);
return TRUE;
}
if (hdr->sh_size != sizeof (Elf32_External_RegInfo))
{
_bfd_error_handler
- (_("%pB: Incorrect `.reginfo' section size; "
+ (_("%pB: incorrect `.reginfo' section size; "
"expected %" PRIu64 ", got %" PRIu64),
abfd, (uint64_t) sizeof (Elf32_External_RegInfo),
(uint64_t) hdr->sh_size);
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: 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 */
- (_("%pB: 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 */
- (_("%pB: 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 */
- (_("%pB: 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 */
- (_("%pB: Malformed reloc detected for section %s"),
+ (_("%pB: malformed reloc detected for section %s"),
abfd, name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
/* The .reginfo section has a fixed size. */
sect = bfd_get_section_by_name (output_bfd, ".reginfo");
if (sect != NULL)
- bfd_set_section_size (output_bfd, sect, sizeof (Elf32_External_RegInfo));
+ {
+ bfd_set_section_size (output_bfd, sect, sizeof (Elf32_External_RegInfo));
+ sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
+ }
/* The .MIPS.abiflags section has a fixed size. */
sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags");
if (sect != NULL)
- bfd_set_section_size (output_bfd, sect, sizeof (Elf_External_ABIFlags_v0));
+ {
+ bfd_set_section_size (output_bfd, sect,
+ sizeof (Elf_External_ABIFlags_v0));
+ sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
+ }
hti.info = info;
hti.output_bfd = output_bfd;
sec);
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: Can't find matching LO16 reloc against `%s'"
+ (_("%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);
msg = NULL;
if (jal_reloc_p (howto->type))
msg = (cross_mode_jump_p
- ? _("Cannot convert a jump to JALX "
+ ? _("cannot convert a jump to JALX "
"for a non-word-aligned address")
: (howto->type == R_MIPS16_26
- ? _("Jump to a non-word-aligned address")
- : _("Jump to a non-instruction-aligned address")));
+ ? _("jump to a non-word-aligned address")
+ : _("jump to a non-instruction-aligned address")));
else if (b_reloc_p (howto->type))
msg = (cross_mode_jump_p
- ? _("Cannot convert a branch to JALX "
+ ? _("cannot convert a branch to JALX "
"for a non-word-aligned address")
- : _("Branch to a non-instruction-aligned address"));
+ : _("branch to a non-instruction-aligned address"));
else if (aligned_pcrel_reloc_p (howto->type))
msg = _("PC-relative load from unaligned address");
if (msg)
default:
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: Unknown architecture %s"),
+ (_("%pB: unknown architecture %s"),
abfd, bfd_printable_name (abfd));
}
bfd *input_bfd;
Elf32_External_RegInfo ext;
Elf32_RegInfo sub;
+ bfd_size_type sz;
if (p->type != bfd_indirect_link_order)
{
input_section = p->u.indirect.section;
input_bfd = input_section->owner;
+ sz = (input_section->size < sizeof (ext)
+ ? input_section->size : sizeof (ext));
+ memset (&ext, 0, sizeof (ext));
if (! bfd_get_section_contents (input_bfd, input_section,
- &ext, 0, sizeof ext))
+ &ext, 0, sz))
return FALSE;
bfd_mips_elf32_swap_reginfo_in (input_bfd, &ext, &sub);
}
/* Size has been set in _bfd_mips_elf_always_size_sections. */
- if (o->size != sizeof (Elf32_External_RegInfo))
- {
- _bfd_error_handler
- (_("%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_ASSERT(o->size == sizeof (Elf32_External_RegInfo));
/* Skip this section later on (I don't think this currently
matters, but someday it might). */
if (!out_string && !in_string)
/* xgettext:c-format */
_bfd_error_handler
- (_("Warning: %pB 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: %pB uses unknown floating point ABI %d "
+ (_("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: %pB uses %s (set by %pB), "
+ (_("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: %pB uses %s (set by %pB), %pB 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: %pB uses %s (set by %pB), "
+ (_("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);
case Val_GNU_MIPS_ABI_MSA_128:
_bfd_error_handler
/* xgettext:c-format */
- (_("Warning: %pB uses unknown MSA ABI %d "
+ (_("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");
default:
_bfd_error_handler
/* xgettext:c-format */
- (_("Warning: %pB 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);
if (LEVEL_REV (in_abiflags.isa_level, in_abiflags.isa_rev)
< LEVEL_REV (abiflags.isa_level, abiflags.isa_rev))
_bfd_error_handler
- (_("%pB: 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
- (_("%pB: 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
- (_("%pB: 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
- (_("%pB: 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
- (_("%pB: 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);
}