aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJim Wilson <jimw@sifive.com>2018-05-18 14:03:18 -0700
committerJim Wilson <jimw@sifive.com>2018-05-18 14:03:18 -0700
commit7f99954970001cfc1b155d877ac2966d77e2c647 (patch)
tree585e05cfeb9fc8e287b7b607bc27851b90ebf30c /bfd
parentAllocate dwp_file with new (diff)
downloadbinutils-gdb-7f99954970001cfc1b155d877ac2966d77e2c647.tar.gz
binutils-gdb-7f99954970001cfc1b155d877ac2966d77e2c647.tar.bz2
binutils-gdb-7f99954970001cfc1b155d877ac2966d77e2c647.zip
RISC-V: Add RV32E support.
Kito Cheng <kito.cheng@gmail.com> Monk Chiang <sh.chiang04@gmail.com> bfd/ * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Handle EF_RISCV_RVE. binutils/ * readelf.c (get_machine_flags): Handle EF_RISCV_RVE. gas/ * config/tc-riscv.c (rve_abi): New. (riscv_set_options): Add rve field. Initialize it. (riscv_set_rve) New function. (riscv_set_arch): Support 'e' ISA subset. (reg_lookup_internal): If rve, check register is available. (riscv_set_abi): New parameter rve. (md_parse_option): Pass new argument to riscv_set_abi. (riscv_after_parse_args): Call riscv_set_rve. If rve_abi, set EF_RISCV_RVE. * doc/c-riscv.texi (-mabi): Document new ilp32e argument. include/ * elf/riscv.h (EF_RISCV_RVE): New define.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfnn-riscv.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b24aba1afc8..cc8773cb144 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-18 Kito Cheng <kito.cheng@gmail.com>
+
+ * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Handle
+ EF_RISCV_RVE.
+
2018-05-18 Jim Wilson <jimw@sifive.com>
* elfnn-riscv.c (allocate_dynrelocs): Discard dynamic relocations if
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index b17c0e10007..b82e655b7be 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -2625,6 +2625,14 @@ _bfd_riscv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
goto fail;
}
+ /* Disallow linking RVE and non-RVE. */
+ if ((old_flags ^ new_flags) & EF_RISCV_RVE)
+ {
+ (*_bfd_error_handler)
+ (_("%pB: can't link RVE with other target"), ibfd);
+ goto fail;
+ }
+
/* Allow linking RVC and non-RVC, and keep the RVC flag. */
elf_elfheader (obfd)->e_flags |= new_flags & EF_RISCV_RVC;