aboutsummaryrefslogtreecommitdiff
path: root/gas/dwarf2dbg.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-11-04 23:03:10 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-11-28 00:03:05 +0000
commit0ac2b354ee006d94d6fc46bea08f39f99b18f869 (patch)
treee835558df4225cb8542515eb3ab5a65eaeef924b /gas/dwarf2dbg.c
parent22eb4a06176dfef554008a62844e0ce30df2260f (diff)
downloadgdb-0ac2b354ee006d94d6fc46bea08f39f99b18f869.zip
gdb-0ac2b354ee006d94d6fc46bea08f39f99b18f869.tar.gz
gdb-0ac2b354ee006d94d6fc46bea08f39f99b18f869.tar.bz2
gas/riscv: Produce version 3 DWARF CIE by default
The flag controlling the default DWARF CIE version to produce now starts with the value -1. This can be modified with the command line flag as before, but after command line flag processing, in md_after_parse_args targets can, if the global still has the value -1, override this value. This gives a target specific default. If a CIE version is not select either by command line flag, or a target specific default, then some new code in dwarf2_init now select a global default. This remains as version 1 to match previous behaviour. This RISC-V has a target specific default of version provided, this make the return column uleb128, which means we can use all DWARF registers include CSRs. I chose to switch to version 3 rather than version 4 as this is most similar to the global default (version 1). Switching to version 4 adds additional columns to the CIE header. gas/ChangeLog: * as.c (flag_dwarf_cie_version): Change initial value to -1, and update comment. * config/tc-riscv.c (riscv_after_parse_args): Set flag_dwarf_cie_version if it has not already been set. * dwarf2dbg.c (dwarf2_init): Initialise flag_dwarf_cie_version if needed. * testsuite/gas/riscv/default-cie-version.d: New file. * testsuite/gas/riscv/default-cie-version.s: New file. ld/ChangeLog: * testsuite/ld-elf/eh5.d: Accept version 3 DWARF CIE. Change-Id: Ibbfe8f0979fba480bf0a359978b09d2b3055555e
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r--gas/dwarf2dbg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 001e2a1..fd6ab54 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -2171,6 +2171,17 @@ void
dwarf2_init (void)
{
last_seg_ptr = &all_segs;
+
+ /* Select the default CIE version to produce here. The global
+ starts with a value of -1 and will be modified to a valid value
+ either by the user providing a command line option, or some
+ targets will select their own default in md_after_parse_args. If
+ we get here and the global still contains -1 then it is up to us
+ to pick a sane default. The default we choose is 1, this is the
+ CIE version gas has produced for a long time, and there seems no
+ reason to change it yet. */
+ if (flag_dwarf_cie_version == -1)
+ flag_dwarf_cie_version = 1;
}