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 D63CF385841D for ; Wed, 27 Jul 2022 01:34:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D63CF385841D 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 AQAAf9Dxv9EdluBi7R47AA--.19725S2; Wed, 27 Jul 2022 09:34:22 +0800 (CST) Subject: Re: [PATCH] LoongArch: adjust the default of -mexplicit-relocs by checking gas feature To: Xi Ruoyao , gcc-patches@gcc.gnu.org Cc: xuchenghua@loongson.cn, Wang Xuerui References: <20220726072119.2910839-1-chenglulu@loongson.cn> <25a7d2fcac8194083e58ed960eaf0f42dafc0559.camel@xry111.site> <93f7b58a-d7a7-543a-21e1-19d237593426@loongson.cn> <653cf06d-da9c-419d-8c70-55962163b155@loongson.cn> From: Lulu Cheng Message-ID: Date: Wed, 27 Jul 2022 09:34:21 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID: AQAAf9Dxv9EdluBi7R47AA--.19725S2 X-Coremail-Antispam: 1UD129KBjvdXoWrKry3ZF1kJFWrAFW5ArWUJwb_yoWDXrbEkF 10q3WxAa1YyFs7tF1FyF4rGF409r9Yvrn8KryYqF4xuas7Z3y0krWDu34avFn2ya4rKF4U Cr1vyFW0yw12vjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbsAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j 6F4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r 4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2Wl Yx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbV WUJVW8JwACjcxG0xvEwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc7I2V7IY0VAS07Al zVAYIcxG8wCY02Avz4vE-syl42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr 1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE 14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7 IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvE x4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnU UI43ZEXa7VUbrMaUUUUUU== X-CM-SenderInfo: xfkh0wpoxo3qxorr0wxvrqhubq/ X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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: Wed, 27 Jul 2022 01:34:27 -0000 在 2022/7/26 下午10:15, Xi Ruoyao 写道: > > The following should work. I've tested it locally by building GCC with > both old (2.38 with patch) and new (trunk) Binutils. Ok for trunk? > > I simply checked as instead of ld. If as supports explicitly > relocations, the produced .o file won't be supported by an old ld even > if we use -mno-explicit-relocs (because as will generate new relocation > types for la.local etc). So such a mismatch between as and ld can be > considered "completely broken" and we don't need to support it. And, > the Alpha port also check the assembler for the default of -mexplicit- > relocs. > > This should be documented in invoke.texi, but currently it does not > mention -mexplicit-relocs for LoongArch at all. So I'll submit the > doclater in another patch. > > -- >8 -- > > The assembly produced with -mexplicit-relocs is not supported by gas <= > 2.39. Check if the assembler supports explicit relocations and set the > default accordingly. Looks good to me.