From: Vasily Gorbik <gor@linux.ibm.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] s390/build: use size command to perform empty .bss check
Date: Wed, 7 Aug 2019 09:54:51 +0200 [thread overview]
Message-ID: <your-ad-here.call-01565164491-ext-3516@work.hours> (raw)
In-Reply-To: <CAK7LNATyNWjwVXdbgXt0mL+3R8jTGe_cq1vEW8_VvB250P4bdg@mail.gmail.com>
On Wed, Aug 07, 2019 at 11:33:40AM +0900, Masahiro Yamada wrote:
> On Tue, Aug 6, 2019 at 7:56 PM Vasily Gorbik <gor@linux.ibm.com> wrote:
> >
> > Currently empty .bss checks performed do not pay attention to "common
> > objects" in object files which end up in .bss section eventually.
> >
> > The "size" tool is a part of binutils and since version 2.18 provides
> > "--common" command line option, which allows to account "common objects"
> > sizes in .bss section size. Utilize "size --common" to perform accurate
> > check that .bss section is unused. Besides that the size tool handles
> > object files without .bss section gracefully and doesn't require
> > additional objdump run.
> >
> > The linux kernel requires binutils 2.20 since 4.13.
> >
> > Kbuild exports OBJSIZE to reference the right size tool.
> >
> > Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
> > ---
> > arch/s390/scripts/Makefile.chkbss | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/arch/s390/scripts/Makefile.chkbss b/arch/s390/scripts/Makefile.chkbss
> > index 884a9caff5fb..ba1d7a8a242f 100644
> > --- a/arch/s390/scripts/Makefile.chkbss
> > +++ b/arch/s390/scripts/Makefile.chkbss
> > @@ -11,8 +11,7 @@ chkbss: $(addprefix $(obj)/, $(chkbss-files))
> >
> > quiet_cmd_chkbss = CHKBSS $<
> > cmd_chkbss = \
> > - if $(OBJDUMP) -h $< | grep -q "\.bss" && \
> > - ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \
> > + if ! $(OBJSIZE) --common $< | awk 'END { if ($$3) exit 1 }'; then \
>
> While you are touching this line,
> you may also want to replace 'awk' with $(AWK),
> which is defined in the top-level Makefile.
Indeed, thank you!
next prev parent reply other threads:[~2019-08-07 7:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 10:56 [PATCH 1/2] kbuild: add OBJSIZE variable for the size tool Vasily Gorbik
2019-08-06 10:56 ` [PATCH 2/2] s390/build: use size command to perform empty .bss check Vasily Gorbik
2019-08-07 2:33 ` Masahiro Yamada
2019-08-07 7:54 ` Vasily Gorbik [this message]
2019-08-07 2:32 ` [PATCH 1/2] kbuild: add OBJSIZE variable for the size tool Masahiro Yamada
2019-08-07 8:01 ` Vasily Gorbik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=your-ad-here.call-01565164491-ext-3516@work.hours \
--to=gor@linux.ibm.com \
--cc=arnd@arndb.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®