From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t4622.austin.hp.com (g2t4622.austin.hp.com [15.73.212.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5154F21CB74B5 for ; Mon, 3 Jul 2017 22:30:27 -0700 (PDT) Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.158.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by g2t4622.austin.hp.com (Postfix) with ESMTPS id C6BAE374; Tue, 4 Jul 2017 05:32:03 +0000 (UTC) From: Abner Chang To: edk2-devel@lists.01.org Date: Tue, 4 Jul 2017 13:29:23 +0800 Message-Id: <1499146164-26231-4-git-send-email-abner.chang@hpe.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499146164-26231-1-git-send-email-abner.chang@hpe.com> References: <1499146164-26231-1-git-send-email-abner.chang@hpe.com> Subject: [staging/branch RISC-V PATCH 3/4] BaseTools: Add more RISC-V relocation types. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jul 2017 05:30:27 -0000 Add more RISC-V relocation types to prevent from errors happen when build RISC-V edk2 port by RISC-V gcc 7.1.1. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Abner Chang --- BaseTools/Source/C/GenFw/Elf64Convert.c | 18 +++++++++++++++++- BaseTools/Source/C/GenFw/elf_common.h | 10 +++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c index 9deb846..4857485 100644 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -3,7 +3,7 @@ Elf64 convert solution Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
Portions copyright (c) 2013-2014, ARM Ltd. All rights reserved.
-Copyright (c) 2016, Hewlett Packard Enterprise Development LP. All rights reserved.
+Copyright (c) 2016-2017, Hewlett Packard Enterprise Development LP. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this @@ -953,6 +953,14 @@ WriteSections64 ( case R_RISCV_GPREL_I: case R_RISCV_GPREL_S: case R_RISCV_CALL: + case R_RISCV_RVC_BRANCH: + case R_RISCV_RVC_JUMP: + case R_RISCV_RELAX: + case R_RISCV_SUB6: + case R_RISCV_SET6: + case R_RISCV_SET8: + case R_RISCV_SET16: + case R_RISCV_SET32: break; default: @@ -1129,6 +1137,14 @@ WriteRelocations64 ( case R_RISCV_GPREL_I: case R_RISCV_GPREL_S: case R_RISCV_CALL: + case R_RISCV_RVC_BRANCH: + case R_RISCV_RVC_JUMP: + case R_RISCV_RELAX: + case R_RISCV_SUB6: + case R_RISCV_SET6: + case R_RISCV_SET8: + case R_RISCV_SET16: + case R_RISCV_SET32: break; default: diff --git a/BaseTools/Source/C/GenFw/elf_common.h b/BaseTools/Source/C/GenFw/elf_common.h index 0ff9720..65ec5f7 100644 --- a/BaseTools/Source/C/GenFw/elf_common.h +++ b/BaseTools/Source/C/GenFw/elf_common.h @@ -3,7 +3,7 @@ Ported ELF include files from FreeBSD Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.
Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-Copyright (c) 2016, Hewlett Packard Enterprise Development LP. All rights reserved.
+Copyright (c) 2016-2017, Hewlett Packard Enterprise Development LP. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1109,4 +1109,12 @@ typedef struct { #define R_RISCV_RVC_LUI 46 #define R_RISCV_GPREL_I 47 #define R_RISCV_GPREL_S 48 +#define R_RISCV_TPREL_I 49 +#define R_RISCV_TPREL_S 50 +#define R_RISCV_RELAX 51 +#define R_RISCV_SUB6 52 +#define R_RISCV_SET6 53 +#define R_RISCV_SET8 54 +#define R_RISCV_SET16 55 +#define R_RISCV_SET32 56 #endif /* !_SYS_ELF_COMMON_H_ */ -- 2.7.4