All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	Michal Marek <mmarek@suse.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	kbuild test robot <fengguang.wu@intel.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Nicolas Pitre <nicolas.pitre@linaro.org>
Subject: Re: [PATCH 1/5] kbuild: thin archives final link close --whole-archives option
Date: Fri, 23 Jun 2017 02:12:40 +1000	[thread overview]
Message-ID: <20170623021240.396b2f63@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <CAK8P3a1o91guXimc99sY3UOUjKTX5QxhQyOfY+j-x7MMCdRbdw@mail.gmail.com>

On Wed, 21 Jun 2017 12:49:10 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> On Wed, Jun 21, 2017 at 12:38 PM, Nicholas Piggin <npiggin@gmail.com> wrote:
> > On Wed, 21 Jun 2017 12:21:16 +0200
> > Arnd Bergmann <arnd@arndb.de> wrote:
> >  
> >> On Wed, Jun 21, 2017 at 11:16 AM, Nicholas Piggin <npiggin@gmail.com> wrote:  
> >> > On Wed, 21 Jun 2017 09:15:09 +0200
> >> > Arnd Bergmann <arnd@arndb.de> wrote:
> >> >  
> >> >> On Wed, Jun 21, 2017 at 6:04 AM, Nicholas Piggin <npiggin@gmail.com> wrote:  
> >> >> > On Wed, 21 Jun 2017 12:29:33 +0900
> >> >> > Masahiro Yamada <yamada.masahiro@socionext.com> wrote:  
> >> >>  
> >> >> >> BTW, I saw abuse of lib.a in
> >> >> >> https://patchwork.kernel.org/patch/9768439/
> >> >> >>
> >> >> >> I see it in linux-next.
> >> >> >>
> >> >> >> commit 06e226c7fb233f676b01b144d0b321ebe510fdcd
> >> >> >> Author: Stephen Boyd <sboyd@codeaurora.org>
> >> >> >> Date:   Fri Jun 2 15:30:06 2017 -0700
> >> >> >>
> >> >> >>     clk: sunxi-ng: Move all clock types to a library
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> Now drivers/clk/sunxi-ng/lib.a
> >> >> >> will go into thin archives.
> >> >> >> The result might be different from what they expect...  
> >> >> >
> >> >> > Yes I see. With thin archives, that is just going to cause the
> >> >> > same behaviour as built-in.o (everything will be linked). So the
> >> >> > build should not break, but they won't get savings.
> >> >> >
> >> >> > Does it even save space with incremental linking? If the lib.a gets
> >> >> > linked into drivers/built-in.o, I wonder what happens then?  
> >> >>
> >> >> Ah, too bad. I thought we had found a way to use a library correctly
> >> >> here, but I just verified that indeed all the just gets linked into built-in.o
> >> >>
> >> >> I played around with it some more now, but without success: if I
> >> >> build sunxi-ng as a loadable module (using a few modifications),
> >> >> then the unneeded objects from lib.a are dropped as I had hoped,
> >> >> but for built-in code we now always include everything.
> >> >>
> >> >> I suppose that we can ignore this once we get
> >> >> LD_DEAD_CODE_DATA_ELIMINATION enabled on ARM, but
> >> >> until then, we have a code size regression.  
> >> >
> >> > I didn't follow the thread there, is it a regression caused by
> >> > thin archives, or just by removing the Kconfig symbol from each
> >> > file?  
> >>
> >> I thought it was the latter, but actually it only happens with thin
> >> archives,  
> >
> > Is this including these changes now in the kbuild tree?  
> 
> I'm building on top of yesterday's linux-next at the moment,
> with a number of my own patches applied
> 
> > I can take a look at ARM and try to get it at least to parity with
> > incremental link. Any particular config options required?  
> 
> This is the patch I am testing with:
> 
> https://pastebin.com/HQuhCEmK
> 
> I have not looked at that in a while, no idea if it works, or
> if it has known problems.
> 
> I last posted the patch in March for discussion:
> 
> https://patchwork.kernel.org/patch/9626207/

Your patch needs the KEEP annotations on the other exception table
bits to avoid that error.

After that it builds and no obvious sections or symbols are missing
but it would take more careful review.

diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 7b9a7058c32c..218ab698970a 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -91,8 +91,8 @@ SECTIONS
                ARM_EXIT_DISCARD(EXIT_DATA)
                EXIT_CALL
 #ifndef CONFIG_MMU
-               *(.text.fixup)
-               *(__ex_table)
+               KEEP(*(.text.fixup))
+               KEEP(*(__ex_table))
 #endif
 #ifndef CONFIG_SMP_ON_UP
                *(.alt.smp.init)
@@ -144,7 +144,7 @@ SECTIONS
        __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
                __start___ex_table = .;
 #ifdef CONFIG_MMU
-               *(__ex_table)
+               KEEP(*(__ex_table))
 #endif
                __stop___ex_table = .;
        }

  parent reply	other threads:[~2017-06-22 16:12 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09  5:24 [PATCH 0/5] move everyone over to thin archives Nicholas Piggin
2017-06-09  5:24 ` [PATCH 1/5] kbuild: thin archives final link close --whole-archives option Nicholas Piggin
2017-06-19  6:16   ` Masahiro Yamada
2017-06-19  6:51     ` Nicholas Piggin
2017-06-19  8:14       ` Masahiro Yamada
2017-06-19  8:27         ` Nicholas Piggin
2017-06-19  8:35           ` Masahiro Yamada
2017-06-19 15:52             ` Nicholas Piggin
2017-06-19 23:48               ` Josh Triplett
2017-06-21  1:17               ` Masahiro Yamada
2017-06-21  2:47                 ` Nicholas Piggin
2017-06-21  3:29                   ` Masahiro Yamada
2017-06-21  4:04                     ` Nicholas Piggin
2017-06-21  7:15                       ` Arnd Bergmann
2017-06-21  9:16                         ` Nicholas Piggin
2017-06-21 10:21                           ` Arnd Bergmann
2017-06-21 10:38                             ` Nicholas Piggin
2017-06-21 10:49                               ` Arnd Bergmann
2017-06-21 10:51                                 ` Arnd Bergmann
2017-06-21 11:10                                 ` Nicholas Piggin
2017-06-21 11:32                                   ` Arnd Bergmann
2017-06-21 12:02                                     ` Nicholas Piggin
2017-06-21 12:21                                       ` Arnd Bergmann
2017-06-21 16:19                                         ` Stephen Boyd
2017-06-21 18:08                                           ` Nicholas Piggin
2017-06-21 20:55                                             ` Arnd Bergmann
2017-06-22  6:18                                               ` Maxime Ripard
2017-06-22 15:50                                                 ` Nicholas Piggin
2017-06-23  5:31                                                   ` Masahiro Yamada
2017-06-23 14:57                                                     ` Maxime Ripard
2017-06-23 15:04                                                       ` Arnd Bergmann
2017-06-25  3:55                                                         ` Masahiro Yamada
2017-06-27 15:42                                                         ` Maxime Ripard
2017-06-21 20:52                                     ` Arnd Bergmann
2017-06-21 21:30                                       ` Nicholas Piggin
2017-06-21 21:44                                         ` Arnd Bergmann
2017-06-22 16:12                                 ` Nicholas Piggin [this message]
2017-06-09  5:24 ` [PATCH 2/5] kbuild: thin archives use P option to ar Nicholas Piggin
2017-06-19  6:17   ` Masahiro Yamada
2017-06-19  6:52     ` Nicholas Piggin
2017-06-09  5:24 ` [PATCH 3/5] sh: thin archives fix linking Nicholas Piggin
2017-06-09  5:24   ` Nicholas Piggin
2017-06-19  6:19   ` Masahiro Yamada
2017-06-19  6:19     ` Masahiro Yamada
2017-06-21 22:09     ` Rob Landley
2017-06-21 22:09       ` Rob Landley
2017-06-09  5:24 ` [PATCH 4/5] x86/um: thin archives build fix Nicholas Piggin
2017-06-19  6:21   ` Masahiro Yamada
2017-06-09  5:24 ` [PATCH 5/5] kbuild: thin archives make default for all archs Nicholas Piggin
2017-06-19  6:22   ` Masahiro Yamada
2017-06-19  6:55     ` Nicholas Piggin
2017-06-17 13:10 ` [PATCH 0/5] move everyone over to thin archives Nicholas Piggin
2017-06-19  6:30   ` Masahiro Yamada

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=20170623021240.396b2f63@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=arnd@arndb.de \
    --cc=fengguang.wu@intel.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.com \
    --cc=nicolas.pitre@linaro.org \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.