From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bahamut.mc.pp.se (bahamut.mc.pp.se [IPv6:2001:470:dcd3:1:214:4fff:fe97:7322]) by sourceware.org (Postfix) with ESMTP id B17D7386F450 for ; Sun, 27 Dec 2020 14:53:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B17D7386F450 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mc.pp.se Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=marcus@mc.pp.se Received: from momoka (momoka [192.168.42.37]) by bahamut.mc.pp.se (Postfix) with SMTP id 84DBEA2406; Sun, 27 Dec 2020 15:53:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mc.pp.se; s=hedgehog; t=1609080828; bh=urNNv2OPBhOPFXGQikZOqEBar5gaUh+3LBloaBhhCgA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=MwRer04EApeRXE/jDzr27MAh +Fg57UFJSWZz9WQNIupWZ0xsL8nRokXOzUsbe2gtZAjt7VGyP8jh6ZOPA5kILCbC4Mh CzyAEXh9hhZygf4oQs28GVGzkU/WQd0aftszh+guXEYcCY1rAEKEfe2knpdPFDWqj5C qf0V5oxlfUCcg= Received: by momoka (sSMTP sendmail emulation); Sun, 27 Dec 2020 15:53:47 +0100 From: "Marcus Comstedt" To: binutils@sourceware.org Cc: Marcus Comstedt Subject: [PATCH v3 4/8] RISC-V: Recognize riscvNNbe* as target Date: Sun, 27 Dec 2020 15:53:31 +0100 Message-Id: <20201227145335.10521-5-marcus@mc.pp.se> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201227145335.10521-1-marcus@mc.pp.se> References: <20201227145335.10521-1-marcus@mc.pp.se> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 14:53:51 -0000 bfd/ * config.bfd (riscvbe-*-*, riscv32be*-*-*), (riscv64be*-*-*): Add target. gas/ * configure.tgt: (riscv64be*, riscv32be*, riscvbe*): Add them. (riscv*-*-*): Remove little endian override. ld/ * configure.tgt: Add riscvbe-*-*, riscv32be*-*-*, riscv64be*-*-*, riscv32be*-*-linux*, and riscv64be*-*-linux*. --- bfd/config.bfd | 10 ++++++++++ config.sub | 2 +- gas/configure.tgt | 4 +++- ld/configure.tgt | 25 +++++++++++++++++++++---- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/bfd/config.bfd b/bfd/config.bfd index 2ae8b1a4cc..f792bd01df 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -1158,11 +1158,21 @@ case "${targ}" in ;; #ifdef BFD64 + riscvbe-*-* | riscv32be*-*-*) + targ_defvec=riscv_elf32_be_vec + targ_selvecs="riscv_elf32_vec riscv_elf64_vec riscv_elf32_be_vec riscv_elf64_be_vec" + want64=true + ;; riscv-*-* | riscv32*-*-*) targ_defvec=riscv_elf32_vec targ_selvecs="riscv_elf32_vec riscv_elf64_vec riscv_elf32_be_vec riscv_elf64_be_vec" want64=true ;; + riscv64be*-*-*) + targ_defvec=riscv_elf64_be_vec + targ_selvecs="riscv_elf32_vec riscv_elf64_vec riscv_elf32_be_vec riscv_elf64_be_vec" + want64=true + ;; riscv64*-*-*) targ_defvec=riscv_elf64_vec targ_selvecs="riscv_elf32_vec riscv_elf64_vec riscv_elf32_be_vec riscv_elf64_be_vec" diff --git a/config.sub b/config.sub index f02d43ad50..7bb0fa6b83 100755 --- a/config.sub +++ b/config.sub @@ -1227,7 +1227,7 @@ case $cpu-$vendor in | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | pru \ | pyramid \ - | riscv | riscv32 | riscv64 \ + | riscv | riscv32 | riscv64 | riscvbe | riscv32be | riscv64be \ | rl78 | romp | rs6000 | rx \ | score \ | sh | shl \ diff --git a/gas/configure.tgt b/gas/configure.tgt index cd60f21a74..91eb648513 100644 --- a/gas/configure.tgt +++ b/gas/configure.tgt @@ -89,7 +89,9 @@ case ${cpu} in pj*) cpu_type=pj endian=big ;; powerpc*le*) cpu_type=ppc endian=little ;; powerpc*) cpu_type=ppc endian=big ;; + riscv64be*) cpu_type=riscv endian=big arch=riscv64 ;; riscv64*) cpu_type=riscv endian=little arch=riscv64 ;; + riscv32be*|riscvbe*) cpu_type=riscv endian=big arch=riscv32 ;; riscv32* | riscv*) cpu_type=riscv endian=little arch=riscv32 ;; rs6000*) cpu_type=ppc ;; rl78*) cpu_type=rl78 ;; @@ -357,7 +359,7 @@ case ${generic_target} in pru-*-*) fmt=elf ;; - riscv*-*-*) fmt=elf endian=little ;; + riscv*-*-*) fmt=elf ;; rx-*-linux*) fmt=elf em=linux ;; diff --git a/ld/configure.tgt b/ld/configure.tgt index 70359301b5..1a5cd476c4 100644 --- a/ld/configure.tgt +++ b/ld/configure.tgt @@ -738,21 +738,38 @@ powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;; pru*-*-*) targ_emul=pruelf ;; +riscv32be*-*-linux*) targ_emul=elf32briscv + targ_extra_emuls="elf32briscv_ilp32f elf32briscv_ilp32 elf64briscv elf64briscv_lp64f elf64briscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64" + targ_extra_libpath=$targ_extra_emuls + ;; riscv32*-*-linux*) targ_emul=elf32lriscv - targ_extra_emuls="elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64" + targ_extra_emuls="elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64 elf32briscv elf32briscv_ilp32f elf32briscv_ilp32 elf64briscv elf64briscv_lp64f elf64briscv_lp64" + targ_extra_libpath=$targ_extra_emuls + ;; +riscvbe-*-* | riscv32be*-*-*) + targ_emul=elf32briscv + targ_extra_emuls="elf64briscv elf32lriscv elf64lriscv" targ_extra_libpath=$targ_extra_emuls ;; riscv-*-* | riscv32*-*-*) targ_emul=elf32lriscv - targ_extra_emuls="elf64lriscv" + targ_extra_emuls="elf64lriscv elf32briscv elf64briscv" + targ_extra_libpath=$targ_extra_emuls + ;; +riscv64be*-*-linux*) targ_emul=elf64briscv + targ_extra_emuls="elf64briscv_lp64f elf64briscv_lp64 elf32briscv elf32briscv_ilp32f elf32briscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32" targ_extra_libpath=$targ_extra_emuls ;; riscv64*-*-linux*) targ_emul=elf64lriscv - targ_extra_emuls="elf64lriscv_lp64f elf64lriscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32" + targ_extra_emuls="elf64lriscv_lp64f elf64lriscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32 elf64briscv elf64briscv_lp64f elf64briscv_lp64 elf32briscv elf32briscv_ilp32f elf32briscv_ilp32" + targ_extra_libpath=$targ_extra_emuls + ;; +riscv64be*-*-*) targ_emul=elf64briscv + targ_extra_emuls="elf32briscv elf64lriscv elf32lriscv" targ_extra_libpath=$targ_extra_emuls ;; riscv64*-*-*) targ_emul=elf64lriscv - targ_extra_emuls="elf32lriscv" + targ_extra_emuls="elf32lriscv elf64briscv elf32briscv" targ_extra_libpath=$targ_extra_emuls ;; rs6000-*-aix[5-9]*) targ_emul=aix5rs6 -- 2.26.2