aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-11-04 22:44:48 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-11-28 00:03:05 +0000
commit22eb4a06176dfef554008a62844e0ce30df2260f (patch)
treeb1a99bdf6d2cf9c5201a8b124d05f3353d781ff5 /gas/testsuite
parent4762fe621e84347b6e1ad1f2d16d2bc6cd28495e (diff)
downloadgdb-22eb4a06176dfef554008a62844e0ce30df2260f.zip
gdb-22eb4a06176dfef554008a62844e0ce30df2260f.tar.gz
gdb-22eb4a06176dfef554008a62844e0ce30df2260f.tar.bz2
gas: Check for overflow on return column in version 1 CIE DWARF
In version 1 of DWARF CIE format, the return register column is just a single byte. For targets with large numbers of DWARF registers, any use of a register with a high number for the return column will (currently) silently overflow giving incorrect DWARF. This commit adds an error when the overflow occurs. gas/ChangeLog: * dw2gencfi.c (output_cie): Error on return column overflow. * testsuite/gas/riscv/cie-rtn-col-1.d: New file. * testsuite/gas/riscv/cie-rtn-col-3.d: New file. * testsuite/gas/riscv/cie-rtn-col.s: New file. Change-Id: I1809f739ba7771737ec012807f0260e1a3ed5e64
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/riscv/cie-rtn-col-1.d3
-rw-r--r--gas/testsuite/gas/riscv/cie-rtn-col-3.d17
-rw-r--r--gas/testsuite/gas/riscv/cie-rtn-col.s3
3 files changed, 23 insertions, 0 deletions
diff --git a/gas/testsuite/gas/riscv/cie-rtn-col-1.d b/gas/testsuite/gas/riscv/cie-rtn-col-1.d
new file mode 100644
index 0000000..dba9c0d
--- /dev/null
+++ b/gas/testsuite/gas/riscv/cie-rtn-col-1.d
@@ -0,0 +1,3 @@
+#as: --gdwarf-cie-version=1
+#source: cie-rtn-col.s
+#error: return column number 4929 overflows in CIE version 1
diff --git a/gas/testsuite/gas/riscv/cie-rtn-col-3.d b/gas/testsuite/gas/riscv/cie-rtn-col-3.d
new file mode 100644
index 0000000..a1d71e1
--- /dev/null
+++ b/gas/testsuite/gas/riscv/cie-rtn-col-3.d
@@ -0,0 +1,17 @@
+#objdump: --dwarf=frames
+#as: --gdwarf-cie-version=3
+#source: cie-rtn-col.s
+
+.*: file format elf.*-.*riscv
+
+Contents of the .* section:
+
+
+00000000 [a-zA-Z0-9]+ [a-zA-Z0-9]+ CIE
+ Version: 3
+ Augmentation: .*
+ Code alignment factor: .*
+ Data alignment factor: .*
+ Return address column: 4929
+ Augmentation data: .*
+#...
diff --git a/gas/testsuite/gas/riscv/cie-rtn-col.s b/gas/testsuite/gas/riscv/cie-rtn-col.s
new file mode 100644
index 0000000..b5e3aa6
--- /dev/null
+++ b/gas/testsuite/gas/riscv/cie-rtn-col.s
@@ -0,0 +1,3 @@
+ .cfi_startproc
+ .cfi_return_column mepc
+ .cfi_endproc