proposal to start merging some source files in libbb/

Rich Felker dalias at aerifal.cx
Sat May 20 02:17:14 UTC 2006


On Fri, May 19, 2006 at 05:24:44PM -0400, Rob Landley wrote:
> On Thursday 18 May 2006 1:16 pm, Robert P. J. Day wrote:
> >   just before i head for the gym, a repeat of a thought i had a couple
> > months back.  it seems that there's just too many trivial source files
> > in libbb/, and some of them could be merged and be even more
> > meaningful afterwards.
> >
> >   as a trivial example,
> >
> > 	create_icmp_socket.c
> > 	create_icmp6_socket.c
> 
> Traditionally the compiler could only include or exclude things at the .o 
> level, so if a .o file had some used functions and some unused functions, it 
> would have to include the whole thing.  The compiler didn't know what was and 
> wasn't used, and the linker couldn't cherry-pick below the object file level.  
> So we broke up the .o functions as small as possible to avoid including 
> unused functions.
> 
> We have the ability ability to produce multiple .o files from a single .c 
> file, and we've recently made it easier to use.  More cleanup in that 
> direction is a good thing (followup to svn 15074).
> 
> Binutils has also recently developed the ability to do something vaguely sane, 
> with the --gc-sections option circa binutils 2.17 and up.  That's too new to 
> rely on it, but having that be a CHECK_LD option (disabled by 
> DEBUG_PESSIMIZE) would be a good thing, and perhaps we can rely on it and 
> remove our own workarounds for its absence in around 3 years.

Please don't remove this ever and please don't call it a workaround.
It's the correct way to do this in the C language. GNU binutils' elf
hacks are exactly that, hacks that are specific to a particular (and
particularly nasty) binary format which I don't want to use and which
I hope we can abandon by then...

Rich




More information about the busybox mailing list