From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 4CCA9D81052 for ; Fri, 22 Sep 2023 07:28:08 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=rF9jvf8dyu6tfDbaVWnDwp52t7Eq1YJj484oTY3xeo0=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1695367687; v=1; b=X06yIkz9sUxcT5ocpCuDPip1HPJZdhB7SrsWCSBseB2pWgatSOg1Kv1euEw2zeH2Cq5IUkQD 1SxnelUKsGMWiFr08DdmEPUIx6pV5W+o3QZ+ZWisGbeFLpC1xZ0wIyXxEU24x4n8HNWpQQgTzbO H4fMKxy0asm/HZbXkshyiUjY= X-Received: by 127.0.0.2 with SMTP id LdDDYY7687511xEprZ3vb60c; Fri, 22 Sep 2023 00:28:07 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web10.16065.1695367685723948830 for ; Fri, 22 Sep 2023 00:28:06 -0700 X-Received: from loongson.cn (unknown [10.2.9.245]) by gateway (Coremail) with SMTP id _____8BxY_ACQg1lpM0qAA--.17006S3; Fri, 22 Sep 2023 15:28:02 +0800 (CST) X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cxzt4BQg1l_tsNAA--.30564S2; Fri, 22 Sep 2023 15:28:01 +0800 (CST) From: "Dongyan Qian" To: devel@edk2.groups.io Cc: Rebecca Cran , Liming Gao , Bob Feng , Yuwei Chen , Chao Li Subject: [edk2-devel] [PATCH] BaseTools/GenFw: Add support for LOONGARCH64 relax relocation Date: Fri, 22 Sep 2023 15:27:58 +0800 Message-Id: <20230922072758.1509120-1-qiandongyan@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cxzt4BQg1l_tsNAA--.30564S2 X-CM-SenderInfo: htld0v5rqj5t3q6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,qiandongyan@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: pKC0xgXzQc48rhuZ8kbOm4Qix7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=X06yIkz9; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none Correct relax id from 99 to 100 and added relocation support up to 109 fix gcc14 adds new relocation, and the generated relocation causes the build and compilation to fail. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4559 Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen Cc: Chao Li Signed-off-by: Dongyan Qian --- BaseTools/Source/C/GenFw/Elf64Convert.c | 20 ++++++++++++++++++++ BaseTools/Source/C/GenFw/elf_common.h | 13 ++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c index d53ecb1767..9911db65af 100644 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -1778,7 +1778,17 @@ WriteSections64 ( case R_LARCH_TLS_LD64_HI20: case R_LARCH_TLS_GD_PC_HI20: case R_LARCH_TLS_GD64_HI20: + case R_LARCH_32_PCREL: case R_LARCH_RELAX: + case R_LARCH_DELETE: + case R_LARCH_ALIGN: + case R_LARCH_PCREL20_S2: + case R_LARCH_CFA: + case R_LARCH_ADD6: + case R_LARCH_SUB6: + case R_LARCH_ADD_ULEB128: + case R_LARCH_SUB_ULEB128: + case R_LARCH_64_PCREL: // // These types are not used or do not require fixup. // @@ -2185,7 +2195,17 @@ WriteRelocations64 ( case R_LARCH_TLS_LD64_HI20: case R_LARCH_TLS_GD_PC_HI20: case R_LARCH_TLS_GD64_HI20: + case R_LARCH_32_PCREL: case R_LARCH_RELAX: + case R_LARCH_DELETE: + case R_LARCH_ALIGN: + case R_LARCH_PCREL20_S2: + case R_LARCH_CFA: + case R_LARCH_ADD6: + case R_LARCH_SUB6: + case R_LARCH_ADD_ULEB128: + case R_LARCH_SUB_ULEB128: + case R_LARCH_64_PCREL: // // These types are not used or do not require fixup in PE format files. // diff --git a/BaseTools/Source/C/GenFw/elf_common.h b/BaseTools/Source/C/GenFw/elf_common.h index ccd32804b0..e4d0cdac4f 100644 --- a/BaseTools/Source/C/GenFw/elf_common.h +++ b/BaseTools/Source/C/GenFw/elf_common.h @@ -1144,5 +1144,16 @@ typedef struct { #define R_LARCH_TLS_LD64_HI20 96 #define R_LARCH_TLS_GD_PC_HI20 97 #define R_LARCH_TLS_GD64_HI20 98 -#define R_LARCH_RELAX 99 +#define R_LARCH_32_PCREL 99 +#define R_LARCH_RELAX 100 +#define R_LARCH_DELETE 101 +#define R_LARCH_ALIGN 102 +#define R_LARCH_PCREL20_S2 103 +#define R_LARCH_CFA 104 +#define R_LARCH_ADD6 105 +#define R_LARCH_SUB6 106 +#define R_LARCH_ADD_ULEB128 107 +#define R_LARCH_SUB_ULEB128 108 +#define R_LARCH_64_PCREL 109 + #endif /* !_SYS_ELF_COMMON_H_ */ -- 2.27.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108980): https://edk2.groups.io/g/devel/message/108980 Mute This Topic: https://groups.io/mt/101516908/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-