Message ID | 20230726173024.3684-3-jszhang@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp582389vqo; Wed, 26 Jul 2023 11:21:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlH4KMDHx1LrXaGW+jYWuo3eZH0p14owTsMpeRMi7ooY/WWgGk9WcXMeuzAN84Bc85G/ycWa X-Received: by 2002:a05:6512:ba8:b0:4fd:d7c7:170c with SMTP id b40-20020a0565120ba800b004fdd7c7170cmr2636738lfv.23.1690395661034; Wed, 26 Jul 2023 11:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690395661; cv=none; d=google.com; s=arc-20160816; b=IcWWyWkrj3CYyHDKv2ueBg8QVeIiCBMPGnFiSTYRMqiYIggJDBFVODT7A0waLwussB SaJ9i6Y9EpUs9SI7Cw6YuAW8ErVJV21GIRuYUOPPoiNPVFiAgOlaWaNEg1CGDyCLGOjh d5p6XzSJFF9PnnHOt5xjrLfCaLpkx0JlJQzdP0rxc8PDeX1MPfYRzQ1E2+1fG8Nkqyy2 y8Maj6ve/fiUe2tYQ1KQbStBDmxhAalCdoMSOfOi66Qz6YwVmdQrkP5BMn7W1DaaL01G V5VWjac1Or8Fj92dEspPKYpJ0iRP16kQI5IHknpYIG/Lo824chnmRuylvcvOUt+7Y21s WRhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DVwxJPyF1NYlwGrMQ/sQwTaKDH4Mx/0wzHcHtSNEhTQ=; fh=2AmsHgAxkXvhtq2BfB2hBoQPDQHM9O1rz+6h2hgCO5A=; b=eEEokI2S3RpxtkJxUoaEVqHsMw59ddt8fl4CStjteJOta6s44RJPWfu6eqXpbLdMEp bZybR2W6m4o9+WvJ/gSs6kLjxKwLgBKj4gbiv9zO0MAFFj75t2/cS/vLPnnkFDSsI6nn 15CyVlNMivoPp5IBOTuf7Q4+XuPsqzcnApTR/AsMYxGw3FVSYo58CVcCc0teg6NkvEQE hKERFLvyfu4gqCFP1OFDsW+MR2cmLkw6+RdwGy8XrQrVw174VdfW1IHgYGvRRvzeviGh Vf2kZTDNhAVXViMyaJDYCfjxEl5SUBnvsMG2b9lfrFIiLMUyJVbF0XNKuU66HhzPDDF/ CW6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K+M6E067; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca2-20020aa7cd62000000b005223a5a81d1si4147447edb.247.2023.07.26.11.20.36; Wed, 26 Jul 2023 11:21:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K+M6E067; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231293AbjGZRmJ (ORCPT <rfc822;kloczko.tomasz@gmail.com> + 99 others); Wed, 26 Jul 2023 13:42:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230342AbjGZRmF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Jul 2023 13:42:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82E7C2685 for <linux-kernel@vger.kernel.org>; Wed, 26 Jul 2023 10:42:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 19D9F61BE6 for <linux-kernel@vger.kernel.org>; Wed, 26 Jul 2023 17:42:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D2CAC433C8; Wed, 26 Jul 2023 17:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690393323; bh=fOYigNePlsrUb3dRqIC3/Ob7Qzi/aiqzn31+xV+bzaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K+M6E067FfjPCZKuJZ9lNLLwnZz6jYodnhLy8yF03C92zX0IDO+m+B0T3XW7vgkWO ohRoqa0nqbgJGOpOmKbL4G/WsqqPzBga43sKWCQuGiNdPONCwZR2FpotNJJF+VoDsG GecnymJv0fJbCrZ8cig1QeUA390l7lo07iri5hS+3Dd+IgmGCQ7+pMhqBTaMwwUqY+ bviq+VCCP4wowizlnlhzQcmp9Jkjq8YeCwvKbxVjEQysKW6NxMCTvnjLSsmtp+3a7g WYuiCHaG+Z9eK1oFo7F+f9RxSRMzM9YMqwuWgzSjTI540Z3RGbmbPFFycCmpgJ2Rgc tJeSD92FmJhXQ== From: Jisheng Zhang <jszhang@kernel.org> To: Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu> Cc: Andrew Jones <ajones@ventanamicro.com>, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] riscv: vdso.lds.S: merge .data section into .rodata section Date: Thu, 27 Jul 2023 01:30:23 +0800 Message-Id: <20230726173024.3684-3-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230726173024.3684-1-jszhang@kernel.org> References: <20230726173024.3684-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772508320875922682 X-GMAIL-MSGID: 1772508320875922682 |
Series |
riscv: vdso.lds.S: some improvement
|
|
Commit Message
Jisheng Zhang
July 26, 2023, 5:30 p.m. UTC
The .data section doesn't need to be separate from .rodata section,
they are both readonly.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
arch/riscv/kernel/vdso/vdso.lds.S | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
Comments
On Thu, Jul 27, 2023 at 01:30:23AM +0800, Jisheng Zhang wrote: > The .data section doesn't need to be separate from .rodata section, > they are both readonly. > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > arch/riscv/kernel/vdso/vdso.lds.S | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > > diff --git a/arch/riscv/kernel/vdso/vdso.lds.S b/arch/riscv/kernel/vdso/vdso.lds.S > index d43fd7c7dd11..671aa21769bc 100644 > --- a/arch/riscv/kernel/vdso/vdso.lds.S > +++ b/arch/riscv/kernel/vdso/vdso.lds.S > @@ -29,7 +29,13 @@ SECTIONS > .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr > .eh_frame : { KEEP (*(.eh_frame)) } :text > > - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } > + .rodata : { > + *(.rodata .rodata.* .gnu.linkonce.r.*) > + *(.got.plt) *(.got) > + *(.data .data.* .gnu.linkonce.d.*) > + *(.dynbss) > + *(.bss .bss.* .gnu.linkonce.b.*) Looking at other architectures, it appears the last three lines of sections could be discarded, but I don't know enough about this to state they should be. Thanks, drew > + } > > /* > * This linker script is used both with -r and with -shared. > @@ -44,13 +50,6 @@ SECTIONS > .alternative : { > *(.alternative) > } > - > - .data : { > - *(.got.plt) *(.got) > - *(.data .data.* .gnu.linkonce.d.*) > - *(.dynbss) > - *(.bss .bss.* .gnu.linkonce.b.*) > - } > } > > /* > -- > 2.40.1 >
On Fri, Jul 28, 2023 at 02:57:03PM +0200, Andrew Jones wrote: > On Thu, Jul 27, 2023 at 01:30:23AM +0800, Jisheng Zhang wrote: > > The .data section doesn't need to be separate from .rodata section, > > they are both readonly. > > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > > --- > > arch/riscv/kernel/vdso/vdso.lds.S | 15 +++++++-------- > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > diff --git a/arch/riscv/kernel/vdso/vdso.lds.S b/arch/riscv/kernel/vdso/vdso.lds.S > > index d43fd7c7dd11..671aa21769bc 100644 > > --- a/arch/riscv/kernel/vdso/vdso.lds.S > > +++ b/arch/riscv/kernel/vdso/vdso.lds.S > > @@ -29,7 +29,13 @@ SECTIONS > > .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr > > .eh_frame : { KEEP (*(.eh_frame)) } :text > > > > - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } > > + .rodata : { > > + *(.rodata .rodata.* .gnu.linkonce.r.*) > > + *(.got.plt) *(.got) > > + *(.data .data.* .gnu.linkonce.d.*) > > + *(.dynbss) > > + *(.bss .bss.* .gnu.linkonce.b.*) > > Looking at other architectures, it appears the last three lines of > sections could be discarded, but I don't know enough about this to Hi Andrew, I checked x86, they still keep those sections. From another side, even if those sections are not needed, removing unused sections could be an independent patch, for safe reason or bisect reason. Thanks > state they should be. > > Thanks, > drew > > > > + } > > > > /* > > * This linker script is used both with -r and with -shared. > > @@ -44,13 +50,6 @@ SECTIONS > > .alternative : { > > *(.alternative) > > } > > - > > - .data : { > > - *(.got.plt) *(.got) > > - *(.data .data.* .gnu.linkonce.d.*) > > - *(.dynbss) > > - *(.bss .bss.* .gnu.linkonce.b.*) > > - } > > } > > > > /* > > -- > > 2.40.1 > >
diff --git a/arch/riscv/kernel/vdso/vdso.lds.S b/arch/riscv/kernel/vdso/vdso.lds.S index d43fd7c7dd11..671aa21769bc 100644 --- a/arch/riscv/kernel/vdso/vdso.lds.S +++ b/arch/riscv/kernel/vdso/vdso.lds.S @@ -29,7 +29,13 @@ SECTIONS .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr .eh_frame : { KEEP (*(.eh_frame)) } :text - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } + .rodata : { + *(.rodata .rodata.* .gnu.linkonce.r.*) + *(.got.plt) *(.got) + *(.data .data.* .gnu.linkonce.d.*) + *(.dynbss) + *(.bss .bss.* .gnu.linkonce.b.*) + } /* * This linker script is used both with -r and with -shared. @@ -44,13 +50,6 @@ SECTIONS .alternative : { *(.alternative) } - - .data : { - *(.got.plt) *(.got) - *(.data .data.* .gnu.linkonce.d.*) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - } } /*