From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id D3B763858CDA for ; Tue, 26 Jul 2022 06:36:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3B763858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from [10.20.4.52] (unknown [10.20.4.52]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxj9Jqi99i2RU5AA--.58800S2; Tue, 26 Jul 2022 14:36:27 +0800 (CST) Subject: Re: [pushed][PATCH v1 0/2] LoongArch: Modify the method of obtaining symbolic addresses. To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn References: <20220719130852.2011955-1-chenglulu@loongson.cn> From: Lulu Cheng Message-ID: <14f65155-7f20-dc23-9dbf-596e39a9cf2d@loongson.cn> Date: Tue, 26 Jul 2022 14:36:26 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20220719130852.2011955-1-chenglulu@loongson.cn> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID: AQAAf9Dxj9Jqi99i2RU5AA--.58800S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Cr47Cw43Gr4kXw45uw4fAFb_yoW8Zw1kp3 sruw43tFW8Jr47Ww1kJ34rWwn8JrZ7u342qayagr10ka9rXryrZF10yrZruFnru398AFsI vw1Fgw4Uu3WkA37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUva14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcVAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCYjI0SjxkI62AI1cAE67vI Y487MxkIecxEwVCm-wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s 026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_ JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20x vEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280 aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyT uYvjfU5WlkUUUUU X-CM-SenderInfo: xfkh0wpoxo3qxorr0wxvrqhubq/ X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, MIME_CHARSET_FARAWAY, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2022 06:36:34 -0000 ÔÚ 2022/7/19 ÏÂÎç9:08, Lulu Cheng дµÀ: > 1. The original LA macro instruction is split into two instructions to > obtain the address of the symbol if enable '-mexplicit-relocs'. > 2. Currently, '-mcmodel=' only supports 'normal' mode, because other mode > behaviors are not yet determined. This function is gradually improved > by the subsequent handling. > 3. Modify the method that calls global functions. Changed from 'la.global + jirl' > to 'bl'. > 4. Some R_LARCH_64 in section .eh_frame will to generate R_LARCH_NONE, we > change ASM_PREFERRED_EH_DATA_FORMAT from 'WD_EH_PE_absptr' to > 'WD_EH_PE_pcrel | DW_EH_PE_sdata4' then relocation to R_LARCH_32_PCREL > from R_LARCH_64 in setction .eh_frame and not generate dynamic relocation > for R_LARCH_32_PCREL. > > This new symbol loading method not support by upstream binutils yet, > this GCC port requires the following patches applied to binutils to build. > > https://sourceware.org/pipermail/binutils/2022-July/121849.html > https://sourceware.org/pipermail/binutils/2022-July/121850.html > https://sourceware.org/pipermail/binutils/2022-July/121851.html > https://sourceware.org/pipermail/binutils/2022-July/121852.html > https://sourceware.org/pipermail/binutils/2022-July/121853.html > > Lulu Cheng (2): > LoongArch: Modify the method of obtaining symbolic addresses. > LoongArch: Modify the definition of the ASM_PREFERRED_EH_DATA_FORMAT > macro. > > .../config/loongarch/loongarch-common.cc | 1 + > gcc/config/loongarch/constraints.md | 24 +- > gcc/config/loongarch/genopts/loongarch.opt.in | 4 + > gcc/config/loongarch/loongarch-protos.h | 9 +- > gcc/config/loongarch/loongarch.cc | 660 +++++++++++++----- > gcc/config/loongarch/loongarch.h | 4 +- > gcc/config/loongarch/loongarch.md | 401 +++-------- > gcc/config/loongarch/loongarch.opt | 4 + > gcc/config/loongarch/predicates.md | 56 +- > 9 files changed, 629 insertions(+), 534 deletions(-) >