From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id 877443857353 for ; Thu, 5 Oct 2023 11:19:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 877443857353 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1696504785; bh=zMIxvIK07bMsZ1rjh034vHjbMsbvhwfiFrBKNba2gy8=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=L7mEt81qlSPurS9+MqmPJD0tUgiGGQN5wHif4XDlQY1j6cTJQ6sD/rc1DleOCTvcE K3DKnjWUNltNWkZvZYql//slpwJAaYr5flyea3EMa2ZDulXwLzxFoSoeVJNgSok9RM TM5F+NtAyNM781ltkUkhsL4MFtKav7I8K/RhoTFM= Received: from [127.0.0.1] (unknown [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 02E8266B7D; Thu, 5 Oct 2023 07:19:43 -0400 (EDT) Message-ID: <3316ceeff68fd7e8ca7a9fe1d1e5c58c94d1dad2.camel@xry111.site> Subject: Re: [PATCH 1/2] LoongArch: bfd: Remove elf_seg_map condition in loongarch_elf_relax_section From: Xi Ruoyao To: Jinyang He , mengqinggang , Chenghua Xu , Zhensong Liu , WANG Xuerui Cc: binutils@sourceware.org, Xing Li , yala , Peng Fan Date: Thu, 05 Oct 2023 19:19:42 +0800 In-Reply-To: <16094953d52e88d269591129ed9aed3efa6ae761.camel@xry111.site> References: <20230711084931.18978-1-hejinyang@loongson.cn> <679cafe2-f5fb-dc76-61db-f5ecb6fd1776@loongson.cn> <98e6ae12-404d-010a-4640-b116b4c6899b@loongson.cn> <2b547680-2a07-b3bd-933a-955910981bc2@loongson.cn> <16094953d52e88d269591129ed9aed3efa6ae761.camel@xry111.site> Autocrypt: addr=xry111@xry111.site; prefer-encrypt=mutual; keydata=mDMEYnkdPhYJKwYBBAHaRw8BAQdAsY+HvJs3EVKpwIu2gN89cQT/pnrbQtlvd6Yfq7egugi0HlhpIFJ1b3lhbyA8eHJ5MTExQHhyeTExMS5zaXRlPoiTBBMWCgA7FiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQrKrSDhnnEOPHFgD8D9vUToTd1MF5bng9uPJq5y3DfpcxDp+LD3joA3U2TmwA/jZtN9xLH7CGDHeClKZK/ZYELotWfJsqRcthOIGjsdAPuDgEYnkdPhIKKwYBBAGXVQEFAQEHQG+HnNiPZseiBkzYBHwq/nN638o0NPwgYwH70wlKMZhRAwEIB4h4BBgWCgAgFiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwwACgkQrKrSDhnnEOPjXgD/euD64cxwqDIqckUaisT3VCst11RcnO5iRHm6meNIwj0BALLmWplyi7beKrOlqKfuZtCLbiAPywGfCNg8LOTt4iMD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 2023-10-05 at 18:09 +0800, Xi Ruoyao via Binutils wrote: > Hi Jinyang, >=20 > Any progress on this?=C2=A0 During my attempt trying to balance relaxatio= n > and scheduling better in GCC I found the elf_seg_map condition is > preventing relaxation on *every* shared library (when we are linking a > shared library the elf_seg_map of .text is NULL). >=20 > On a modern system most code paths are in shared libraries, so it's > really bad not to perform the relaxation on them.=C2=A0 Esp. now we are > disabling explicit relocs for relaxation, so if we don't relax shared > libraries we are likely regressing the overall performance of the > system. Phew. It's not only a performance issue. It's actually a *correctness* issue because the condition also causes R_LARCH_ALIGN skipped, so some programs depending on code alignment (for e.g. duff-device-like code using pcaddi for eg) will be broken. Generally skipping the entire relaxation pass for any section containing R_LARCH_ALIGN is wrong (as we've discussed in https://github.com/llvm/llvm-project/pull/67424). Even if we don't really relax a thing we still *must* process R_LARCH_ALIGN. > Sorry for disturbing you during the national holiday, feel free to defer > the reply until the holiday ends! --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University