Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2149026imu; Wed, 28 Nov 2018 23:38:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/UVuN5PshR9OjNWV+ao9clurbyTqLWK6hihYwaKs/kTAqSZjqLMtOnKoa1XMjVY7ypBwdbj X-Received: by 2002:a62:25c2:: with SMTP id l185-v6mr426785pfl.64.1543477089420; Wed, 28 Nov 2018 23:38:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543477089; cv=none; d=google.com; s=arc-20160816; b=y/rWJU7gW9XfcS5RZMnpcx0B5uA9BHG3tQ6ROKhgvobaJ7QF0JvKkNrnAeEnmdd/ww d6Qi0+cIhENKvw/VKvimYTPo+1eCSMrOwdLqjjC+Z3B5xtv/KuRTNnoAdWKFWDEvQ1BF szc7aWsoQNgldj9/eOFmUvRwGObTWac5/1SAr6+TCuYW/RGK2Yfo0QURq5ohTIHTKGQj B4xKFW4n+w9lv8fOa7TSmgMjGnzxFujxruokLQM0VkqMXK2hVzTne+KwOcyXEOv80LZY 2IdbS9xTAwe3Z9qqjIaGAdY3YirgUpYWycxRFFuuW2TKuVZo0LZcuoelZ2lTGqhk1MEj zh/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+YoVQTqH3vy5mPd37GsUvR97cQgim6z/Pdh8hSKwkaw=; b=dj/uAUs2Nn9x1rbaH7hIl8p0z3lqJuwE9SmlA/HDepzcY/SQqVGUTMJ6WLtXmpTW3Y ILjtRG94Lta3TGDAUKlJk76z9Cu4myeR8O+WOacz17YTnpimiTLuTMmvsHGGM0fzEUO8 2WKkn33PKx7vcr75i1Z2hWUzm4Po8Ngyg0Gb8+Nm8Stispe5qzhzVDOYNJMPym5a0X8I 5JQw39etcEGL1zxs0ieQcwzQ/e54o1txuU3nIICz3/Q56BlMCSoCYec8Svxf+KqpLm+N kWakkDmyHjZpaxvQvaVi1gqrVXvO7AGkV1CINK0vsI3L+BFvFuTGikbDeMezbE+YJvJs 8xcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HCBtiLz7; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c32si1395436plj.38.2018.11.28.23.37.54; Wed, 28 Nov 2018 23:38:09 -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=@gmail.com header.s=20161025 header.b=HCBtiLz7; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727169AbeK2SlT (ORCPT + 99 others); Thu, 29 Nov 2018 13:41:19 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:42221 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbeK2SlT (ORCPT ); Thu, 29 Nov 2018 13:41:19 -0500 Received: by mail-ed1-f67.google.com with SMTP id j6so1031008edp.9 for ; Wed, 28 Nov 2018 23:36:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+YoVQTqH3vy5mPd37GsUvR97cQgim6z/Pdh8hSKwkaw=; b=HCBtiLz7Z8e2fAHeBaeyI6yMUWugVwbf3Vzx7hDnSoALdYCEkW9rLI/gi9RxJ3VwdE /yKevyOCIlw/NxgwyPGKHvNdd1ielrwejYJxoAILXV8axKeJVoBtHm/CmYnOT/SVB/rd 3tLq99Bt4Pb721AKciyi8DzhEXCk2IGyG0PT+ABj0wblejrKEclOzRh9q3XIhK1v8pkc knv8V6fe2t/PYZknH3kvzKMNG+43Gzmct+dryTMZyM7YCdlMWpsgd5puW+fdbQUWDzZ5 CEigu7F4IIC7CPrdoGNrx4g/OywAj51TMe9ALCXXVgymRRnqopJf2SthVV7+bbFeD5DJ jeZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+YoVQTqH3vy5mPd37GsUvR97cQgim6z/Pdh8hSKwkaw=; b=GpVKadVmDdBLbE2sFnuSWeMNrwsv4QjxxGq5o5bCmLzgFmY3XvTs6FGfuWWIh5iaGL l56/y7xmWm1i+HxZAm9VlkFYY0XZNvSOGHZJb0+/a6ez4AviiRrFf2cm1mHeq3ue80Jp 4W27el3JPxTVKCBUiw+XfYRcG08HlkosrqRfJGlnk37VOmWS4k0vQyWV20J/ZBMGhtng VhthogZqfsgTx+XkSyWcQsC6YOHPmnUiOhVtns/0MAYLWrzzPZtsG3FtvEGLzkMOyN0l 5kB/zR3XfxF0atT6Uh6A0gqOuZnfFw+27YQcUMQ4Rn5e9/I6e15EpnhlfPY8eSsrxBkC nzdQ== X-Gm-Message-State: AA+aEWZ2JPcnnFQuzWDNg+xEnldhP7OW/9fFwZFEEr3yyl67yam27SBk 9VYlCMv/rHgPt4tJXtssxncJxZs5MhIeskMSrq8= X-Received: by 2002:a17:906:7c52:: with SMTP id g18-v6mr696479ejp.77.1543477012342; Wed, 28 Nov 2018 23:36:52 -0800 (PST) MIME-Version: 1.0 References: <20181126060802.19314-1-anup@brainfault.org> In-Reply-To: <20181126060802.19314-1-anup@brainfault.org> From: Bin Meng Date: Thu, 29 Nov 2018 15:36:41 +0800 Message-ID: Subject: Re: [PATCH] RISC-V: Make BSS section as the last section in vmlinux.lds.S To: Anup Patel Cc: palmer@sifive.com, aou@eecs.berkeley.edu, hch@infradead.org, atish.patra@wdc.com, linux-riscv@lists.infradead.org, linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 2:12 PM 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(-) > Reviewed-by: Bin Meng Tested-by: Bin Meng