aboutsummaryrefslogtreecommitdiff
path: root/gas/itbl-ops.h
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2018-12-03 17:48:49 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2018-12-05 13:23:23 +0000
commit90af06793e9d391c0aa33994f21bba6971d084f7 (patch)
tree28fcd0951972d035bf769717b5c193717b248e2e /gas/itbl-ops.h
parent13f2ed32e14311bdcdb9d6efe263486d5d128cfd (diff)
downloadgdb-90af06793e9d391c0aa33994f21bba6971d084f7.zip
gdb-90af06793e9d391c0aa33994f21bba6971d084f7.tar.gz
gdb-90af06793e9d391c0aa33994f21bba6971d084f7.tar.bz2
gdb/riscv: Improve logic for when h/w float abi should be used
Currently, if the target announces that it has floating point registers in its target description then GDB assumes that the hardware float ABI should be used. However, there's nothing stopping a user compiling a program for the soft-float abi, and then trying to run this on a target with hardware floating point registers. This commit adjusts the logic that decides if GDB should use the hardware float abi. The primary decision now is based on what the ELF currently being executed says in its headers. If the file was compiled for h/w float abi, then GDB uses h/w float abi, otherwise s/w float is used. If the current BFD is not an ELF then we don't currently have a mechanism for figuring out if the file was compiled for float or not. In this case we disable the h/w float abi. This shouldn't be a problem as, right now, the RISC-V linker can only produce ELFs. If there is NO current BFD (can this happen?) then we will enable h/w float abi if the target has floating point hardware, otherwise, s/w float abi is used. This commit also adds some sanity checking that the features requested in the BFD (xlen and flen) match the target description. For testing I ran the testsuite on a target that returns a target description containing both integer and floating point registers, but used a compiler that didn't have floating point support. Before this commit I would see failures on may tests that made inferior calls using floating point arguments, after this commit, all of these issues are resolved. One example from the testsuite is gdb.base/infcall-nested-structs.exp. gdb/ChangeLog: * riscv-tdep.c (riscv_features_from_gdbarch_info): New function. (riscv_find_default_target_description): Use new function to extract feature from gdbarch_info. (riscv_gdbarch_init): Add error checks for xlen and flen between target description and bfd headers. Be smarter about when we think the hardware floating point abi should be used.
Diffstat (limited to 'gas/itbl-ops.h')
0 files changed, 0 insertions, 0 deletions