Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp336781imu; Thu, 20 Dec 2018 23:29:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/XVfOPRImNN5m1hn6LsLJS8tPL1bkpduLVEWKlkoU52TDW/nPUOXhPGCSepZm5n0+gOVopw X-Received: by 2002:a62:1c7:: with SMTP id 190mr1443367pfb.46.1545377370266; Thu, 20 Dec 2018 23:29:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545377370; cv=none; d=google.com; s=arc-20160816; b=bcohnRYDBTgr6uWwcKiiaRXCjiJ9wafZ9V0m/xENoKcmR5orveVGwzmF61uyUilyMj Y4M5sp1KI+bUAezcdCdgQQymIhWlMaQsxDum8W+WcV1iwPl8IhQRQknXjnKXKbxhlf79 uwFzklmllY9RUrv8vFJs0TuehwzvOjHjj9E+XWvFBxC8wNpdF2Ry74Fi0B9QxJ7AQFis a9HCP2QKwg4VJHn1DW0Ma9IRA08tnS741R/TVIUMzLU0S3QR9Ach+7sYqCFD+VtI8juf 4lMLOMTVUh5J0c9emL5ug5HC16m35bReRQvGqzFuJNuw4RRVlVXjVkK+9anLH660q5p3 +OAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=6JsmajvHgjh5zKiNZPfPF+qgRMpvJ7baDvQkLUr1SRk=; b=vLLLv5XsysB8RsmiTionlEyFixqW558xql9kAGQQeoJd83dBs7KGgo4E4wNWT8zIWz 8A+yImSmIHbPbh6aJZ5pl3/Hv/ULkjJnLwfWp1hVYHqQIhS3LMUbi64z8NB0G14v/g+h ca/f12nxC3k4mfLFk3PpepOV6MKBYGe5vngFatchQm1FpgxmKeDYdO50XFZnXzTJhJvQ 2J0xXirb/SmYWUgG1QQ3i+yKd5BiWt7IH4U14WeAThiYdIXRGzDVTSHeW+K2OObefrVP gfDYAaTMW7rnmfAVfy2F/lKc5tNsdYe6g9Hkk7ivWF5fWoCFYW/YQF3IVLb+LCoN6cV+ Sgcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b="B7v/zhuK"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si329984pgg.230.2018.12.20.23.29.14; Thu, 20 Dec 2018 23:29:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b="B7v/zhuK"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388209AbeLTUkh (ORCPT + 99 others); Thu, 20 Dec 2018 15:40:37 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:39348 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727387AbeLTUkf (ORCPT ); Thu, 20 Dec 2018 15:40:35 -0500 Received: by mail-qt1-f193.google.com with SMTP id n21so3346423qtl.6 for ; Thu, 20 Dec 2018 12:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=6JsmajvHgjh5zKiNZPfPF+qgRMpvJ7baDvQkLUr1SRk=; b=B7v/zhuK/o4Zjwe2RNO/FwJugvOj7+uuUa6Hpb0Q43PxVwVT5+QfyUKcKc+pn1cS3A MCa84yX/v7dUTJgp90EQQvNZJw7+lvlc0+ElvGi0Xi+ncWpWcSTcFnaeTI7z1keU8p9b AQqWbJApqrvM2zYddZ1PuLtxxX9bHX6QajXHzWRxFhBLUPwwanCWme6x+ID+C8WRIopQ m+JVF8RxBLY9DKLJ0RfCpiMmOEKGCzVdEBFn9vac3HSnuaCS1U/PKazsUh2l+EqJd7LV oI0XOT/xhpEwQFLHCkehF98rnPjzqDLf7IUlFFqfSnJlGkxM0Az6o0sNgyBW2CzqCEZ3 JStw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=6JsmajvHgjh5zKiNZPfPF+qgRMpvJ7baDvQkLUr1SRk=; b=TRkQeLbJ5ce8SUtkwlNlMlMUQMhHo+KKyVNWgMiWuC+MyICTpacNWRgpXArXNuMb1Z 9rxfWSHr6HYH5FWRbHjS2T4BGgGKneqoamf33WfYHzHByIGQLLKeJu2RQ9/zEdwmgtiW UWgWRGUQ1N0MHetznb9AD6SzTilB+waGWlxbYQU8U+p9QrcD7VJCdcX95L2dO9Ete+L8 a4Ky97iT1u3CQUx9GZue1dCzT/eoI88+eATZP5zG3mQrMzv80UQaAW+2WrJHR88IRe1f K4QJ799INISNr6MvUySX4bV+t2Lr2kxOKfK7oqygQO+2j0GDxGmlUH+NZyVl9Tsvsmdo n3Cg== X-Gm-Message-State: AA+aEWaqMCsW8klMgsfPcu00eK60AZnJ6c1NbC2vRvLPTRliIu35Rq4n jxGJF7+ZPhx2rtN0uhbUB/22XJhyt7c= X-Received: by 2002:a0c:b0db:: with SMTP id p27mr6514652qvc.73.1545338434545; Thu, 20 Dec 2018 12:40:34 -0800 (PST) Received: from localhost ([2601:182:c980:96c:8dd:4488:90b1:59d1]) by smtp.gmail.com with ESMTPSA id r47sm4479171qtc.77.2018.12.20.12.40.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 12:40:33 -0800 (PST) Date: Thu, 20 Dec 2018 12:40:33 -0800 (PST) X-Google-Original-Date: Thu, 20 Dec 2018 12:39:09 PST (-0800) Subject: Re: [PATCH] RISC-V: Make BSS section as the last section in vmlinux.lds.S In-Reply-To: CC: aou@eecs.berkeley.edu, atish.patra@wdc.com, Christoph Hellwig , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: anup@brainfault.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 17 Dec 2018 01:36:45 PST (-0800), anup@brainfault.org wrote: > On Mon, Nov 26, 2018 at 11:42 AM Anup Patel wrote: >> >> The objcopy only emits loadable sections when creating flat kernel >> Image. To have minimal possible size of flat kernel Image, we should >> have all non-loadable sections after loadable sections. >> >> Currently, execption table section (loadable section) is after BSS >> section (non-loadable section) in the RISC-V vmlinux.lds.S. This >> is not optimal for having minimal flat kernel Image size hence this >> patch makes BSS section as the last section in RISC-V vmlinux.lds.S. >> >> In addition, we make BSS section aligned to 16byte instead of PAGE >> aligned which further reduces flat kernel Image size by few KBs. >> >> The flat kernel Image size of Linux-4.20-rc4 using GCC 8.2.0 is >> 8819980 bytes with current RISC-V vmlinux.lds.S and it reduces to >> 7991740 bytes with this patch applied using GCC 8.2.0. In summary, >> this patch reduces Linux-4.20-rc4 flat kernel Image size by 809 KB. >> >> Signed-off-by: Anup Patel >> --- >> arch/riscv/kernel/vmlinux.lds.S | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S >> index 65df1dfdc303..cc99eed44931 100644 >> --- a/arch/riscv/kernel/vmlinux.lds.S >> +++ b/arch/riscv/kernel/vmlinux.lds.S >> @@ -74,8 +74,6 @@ SECTIONS >> *(.sbss*) >> } >> >> - BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0) >> - >> EXCEPTION_TABLE(0x10) >> NOTES >> >> @@ -83,6 +81,8 @@ SECTIONS >> *(.rel.dyn*) >> } >> >> + BSS_SECTION(0x10, 0x10, 0x10) >> + >> _end = .; >> >> STABS_DEBUG >> -- >> 2.17.1 >> > > Hi All, > > Any comment on this patch? Sorry, I haven't had a chance to look at it yet. Aside from the macro issue mentioned by Nick it seems OK.