lkml.org 
[lkml]   [2009]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 0/4] Add support for compiling with -ffunction-sections -fdata-sections
Date
On Tuesday 21 April 2009 01:40, Linus Torvalds wrote:
> Quite frankly, every time I see something like this, I shudder.
>
> Why?
>
> The bugs in the toolchains tend to be infinite and _really_ annoying.

Most bugs are annoying. :)

> We'll end up with everything from "gcc-xyz cannot handle it" to
> "binutils-abc which was pre-released by RH/Ubuntu/SUSE will SIGSEGV".
>
> And those are the _good_ cases. The bad cases are just silently
> miscompiled/linked stuff under certain circumstances.
>
> In other words, I'm not going to merge it without a _lot_ of people
> pushing me on it with nice numbers etc. Because I absolutely hate the
> tools issues that I'm convinced will happen the moment I merge it.

In some cases, section garbage collection discards nearly 10% of dead
code/data from kernel image. Actually, every time I add it to
a software project, I see quite an amount of dead code/data
eliminated. Even sadistic manual splitting of every function
and data object into its own .o file doesn't match it.

I can put it another way: let machine do what it does better,
and faster, than humans ever can:

I was pushing a patch for aic7xxx driver which eliminated ~150k
of dead code. It took a lot of time to eventually make it reach
mainline kernel. On and off, it took years.

With section garbage collection, that patch would not be even needed,
as gcc+ld would automagically detect that that code is dead.
--
vda


\
 
 \ /
  Last update: 2009-04-21 03:07    [W:0.193 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site