aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@mips.com>2018-02-05 14:00:21 +0000
committerMaciej W. Rozycki <macro@mips.com>2018-02-05 14:00:21 +0000
commit2d6dda71611ba6cc16fe2bd21ac816d5f7d1e74d (patch)
tree64d139184ccc165a25a68a53f01467a1a127ebd9 /gas
parent7550610057c51d47e3815ef93893d4f4faa7e03d (diff)
downloadgdb-2d6dda71611ba6cc16fe2bd21ac816d5f7d1e74d.zip
gdb-2d6dda71611ba6cc16fe2bd21ac816d5f7d1e74d.tar.gz
gdb-2d6dda71611ba6cc16fe2bd21ac816d5f7d1e74d.tar.bz2
MIPS/BFD: Correctly report unsupported `.reginfo' section size
Report an error when an unsupported `.reginfo' section size is found in `_bfd_mips_elf_section_processing', removing an assertion that triggers at elfxx-mips.c:7105 in GAS when assembling input like: .section .reginfo .word 0xdeadbeef and in `objcopy --rename-section' when renaming an incorrectly sized section to `.reginfo'. bfd/ * elfxx-mips.c (_bfd_mips_elf_section_processing): For SHT_MIPS_REGINFO sections don't assert the correct size and report an error instead. binutils/ * 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. gas/ * 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.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/testsuite/gas/mips/mips.exp4
-rw-r--r--gas/testsuite/gas/mips/reginfo-2-n32.d4
-rw-r--r--gas/testsuite/gas/mips/reginfo-2.d3
-rw-r--r--gas/testsuite/gas/mips/reginfo-2.l3
-rw-r--r--gas/testsuite/gas/mips/reginfo-2.s2
6 files changed, 24 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 7bbb9ce..6c9ff3e 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,11 @@
+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.
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 74c39d4..d119138 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -1494,6 +1494,10 @@ if { [istarget mips*-*-vxworks*] } {
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"
diff --git a/gas/testsuite/gas/mips/reginfo-2-n32.d b/gas/testsuite/gas/mips/reginfo-2-n32.d
new file mode 100644
index 0000000..ec1f9e3
--- /dev/null
+++ b/gas/testsuite/gas/mips/reginfo-2-n32.d
@@ -0,0 +1,4 @@
+#name: MIPS assembled .reginfo section size (n32)
+#as: -n32 -mips3
+#source: reginfo-2.s
+#error-output: reginfo-2.l
diff --git a/gas/testsuite/gas/mips/reginfo-2.d b/gas/testsuite/gas/mips/reginfo-2.d
new file mode 100644
index 0000000..7bfe7f9
--- /dev/null
+++ b/gas/testsuite/gas/mips/reginfo-2.d
@@ -0,0 +1,3 @@
+#name: MIPS assembled .reginfo section size
+#as: -32
+#error-output: reginfo-2.l
diff --git a/gas/testsuite/gas/mips/reginfo-2.l b/gas/testsuite/gas/mips/reginfo-2.l
new file mode 100644
index 0000000..ea9fef9
--- /dev/null
+++ b/gas/testsuite/gas/mips/reginfo-2.l
@@ -0,0 +1,3 @@
+.*: Incorrect `\.reginfo' section size; expected 24, got 28
+.*: Assembler messages:
+.*: Fatal error: can't close .*: Bad value
diff --git a/gas/testsuite/gas/mips/reginfo-2.s b/gas/testsuite/gas/mips/reginfo-2.s
new file mode 100644
index 0000000..7471062
--- /dev/null
+++ b/gas/testsuite/gas/mips/reginfo-2.s
@@ -0,0 +1,2 @@
+ .section .reginfo
+ .word 0xdeadbeef