+2018-02-05 Maciej W. Rozycki <macro@mips.com>
+
+ * elfxx-mips.c (_bfd_mips_elf_section_processing): For
+ SHT_MIPS_REGINFO sections don't assert the correct size and
+ report an error instead.
+
2018-02-05 Maciej W. Rozycki <macro@mips.com>
* elf.c (_bfd_elf_write_object_contents): Propagate a failure
{
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
+ (_("%B: Incorrect `.reginfo' section size; expected %Lu, got %Lu"),
+ abfd, (bfd_size_type) sizeof (Elf32_External_RegInfo),
+ 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)
+2018-02-05 Maciej W. Rozycki <macro@mips.com>
+
+ * testsuite/binutils-all/mips/mips-reginfo.d: New test.
+ * testsuite/binutils-all/mips/mips-reginfo-n32.d: New test.
+ * testsuite/binutils-all/mips/mips-reginfo.s: New test source.
+ * testsuite/binutils-all/mips/mips.exp: Run the new tests.
+
2018-02-05 Maciej W. Rozycki <macro@mips.com>
* testsuite/config/default.exp (binutils_run): Document
--- /dev/null
+#PROG: objcopy
+#name: MIPS objcopy .reginfo section size (n32)
+#as: -n32 -mips3
+#objcopy: --rename-section .foo=.reginfo
+#source: mips-reginfo.s
+#error: \A[^\n]*: Incorrect `\.reginfo' section size; expected 24, got 4\n
+#error: [^\n]*: Bad value\Z
--- /dev/null
+#PROG: objcopy
+#name: MIPS objcopy .reginfo section size
+#as: -32
+#objcopy: --rename-section .foo=.reginfo
+#error: \A[^\n]*: Incorrect `\.reginfo' section size; expected 24, got 4\n
+#error: [^\n]*: Bad value\Z
--- /dev/null
+ .section .foo, "a"
+ .word 0xdeadbeef
run_dump_test "mips-note-2r-n32"
run_dump_test "mips-note-2r-n64"
}
+
+run_dump_test "mips-reginfo"
+if $has_newabi {
+ run_dump_test "mips-reginfo-n32"
+}
+2018-02-05 Maciej W. Rozycki <macro@mips.com>
+
+ * testsuite/gas/mips/reginfo-2.d: New test.
+ * testsuite/gas/mips/reginfo-2-n32.d: New test.
+ * testsuite/gas/mips/reginfo-2.l: New test stderr output.
+ * testsuite/gas/mips/reginfo-2.s: New test source.
+ * testsuite/gas/mips/mips.exp: Run the new tests.
+
2018-02-05 Nick Clifton <nickc@redhat.com>
* po/ru.po: Updated Russian translation.
run_dump_test "pr12915"
run_dump_test "reginfo-1a"
run_dump_test "reginfo-1b"
+ run_dump_test "reginfo-2"
+ if $has_newabi {
+ run_dump_test "reginfo-2-n32"
+ }
run_dump_test "micromips"
run_dump_test "micromips-trap"
--- /dev/null
+#name: MIPS assembled .reginfo section size (n32)
+#as: -n32 -mips3
+#source: reginfo-2.s
+#error-output: reginfo-2.l
--- /dev/null
+#name: MIPS assembled .reginfo section size
+#as: -32
+#error-output: reginfo-2.l
--- /dev/null
+.*: Incorrect `\.reginfo' section size; expected 24, got 28
+.*: Assembler messages:
+.*: Fatal error: can't close .*: Bad value
--- /dev/null
+ .section .reginfo
+ .word 0xdeadbeef