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 962A63858D37 for ; Sun, 4 Sep 2022 07:00:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 962A63858D37 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 localhost.localdomain (Coremail) with SMTP id AQAAf8AxFeLwTBRjsssQAA--.6199S2; Sun, 04 Sep 2022 15:00:01 +0800 (CST) Subject: Re: [PATCH] LoongArch: add -mdirect-extern-access option To: Xi Ruoyao , gcc-patches@gcc.gnu.org, liuzhensong Cc: Wang Xuerui , Chenghua Xu , Huacai Chen References: <20220901105412.42242-1-xry111@xry111.site> <11ab925378eb7f4ee3a0e8a6a81be45c64aebe00.camel@xry111.site> From: Lulu Cheng Message-ID: <496bac6b-95b0-00ec-a212-0142104950c4@loongson.cn> Date: Sun, 4 Sep 2022 15:00:00 +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: <11ab925378eb7f4ee3a0e8a6a81be45c64aebe00.camel@xry111.site> Content-Type: multipart/alternative; boundary="------------1A09DEB763A6648DD26D348D" Content-Language: en-US X-CM-TRANSID:AQAAf8AxFeLwTBRjsssQAA--.6199S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Jry3KrWkuw4xKw48JrW7twb_yoW8JF4rp3 4DAF1YkrWkZw1ftr1fuw18XFy8ursIvFy5XF48tw1kZw4UXFyYvrs09a9F9Fy7CFZavrZ2 qrs3Wr18ZF1kJaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUv214x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r1j 6r4UM28EF7xvwVC2z280aVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr 0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21lYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0E x4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwACjI8F5V A0II8E6IAqYI8I648v4I1l7480Y4vEI4kI2Ix0rVAqx4xJMxk0xIA0c2IEe2xFo4CEbIxv r21lc2xSY4AK6svPMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I 0E5I8CrVAFwI0_JrI_JrWlx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWU AVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcV CY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAF wI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa 7VUb_gA7UUUUU== X-CM-SenderInfo: xfkh0wpoxo3qxorr0wxvrqhubq/ X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,BODY_8BITS,HTML_MESSAGE,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is a multi-part message in MIME format. --------------1A09DEB763A6648DD26D348D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 在 2022/9/4 下午2:35, Xi Ruoyao 写道: > On Sun, 2022-09-04 at 11:22 +0800, Lulu Cheng wrote: >> 在 2022/9/4 上午10:51, Xi Ruoyao 写道: >> >>> On Sun, 2022-09-04 at 10:26 +0800, Lulu Cheng wrote: >>> >>>> If the above modifications are not added, the function call is: >>>> >>>>  bl %plt(test1) >>>> >>>> now is : >>>> >>>>  bl test1 >>> Regarding "%plt(...)", in the binutils code: >>> >>>    /* For compatible old asm code. */ >>>    if (0 == strcmp (op_c_str, "plt")) >>>      btype = BFD_RELOC_LARCH_B26; >>> >>> Link: >>> https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gas/config/loongarch-parse.y;h=8704687706df50aa15aff05f97e4560d7ec6fa23;hb=refs/heads/master#l131 >>> >>> Zhensong: does "old asm code" here mean we should remove %plt from >>> "new" >>> assembly code, i. e. stop to print %plt(...) in GCC completely? >>> >> >> I think '%plt' also needs to be removed from the readability of the >> assembly code.:-\ > I understand, but maybe we should remove %plt unconditionally, with or > without -mdirect-extern-access. Note that for -mcmodel=medium we don't > say something like "%pc_hi20(%plt(x))" either. I have thought about this problem. For example, there is no '%plt' in aarch64, but I think it can be added and easily distinguished at the assembly code level, so this is not removed. --------------1A09DEB763A6648DD26D348D--