exporting argc/argv to applets

Rich Felker dalias at aerifal.cx
Fri Jul 7 19:58:19 PDT 2006


On Fri, Jul 07, 2006 at 06:19:18PM -0400, Rob Landley wrote:
> On Friday 07 July 2006 1:08 am, Rich Felker wrote:
> > On Thu, Jul 06, 2006 at 08:34:54PM -0400, Mike Frysinger wrote:
> > > On Thursday 06 July 2006 15:18, Rich Felker wrote:
> > > > Global variables are not bp+offset, just fixed address.
> > >
> > > that depends on your build ... with a non-pic binary this is correct
> >
> > Yes we're talking about i386 which always has MMU (afaik anyway), so
> > building with PIC would be rather stupid..
> 
> Go look at http://www.gentoo.org/proj/en/hardened/pic-internals.xml sections 3 

I'm quite familiar with what PIC is and how it's used.

> and 4, and contemplate that like standard system libraries, BusyBox is _also_ 
> likely to have lots and lots of copies of the same executable in memory at 
> once, and could dirty lots of pages with unnecessarily scattered relocations.  

How would there be any relocations? All addresses except calls to the
libc are resolved at link time unless you use shared libbb which we
seem to agree is stupid.

> PIC can optimize for DRAM usage at the expense of on-disk binary size, on a 
> system with an MMU and multiple copies of the same process.

PIC never optimizes, it just makes a costly process (runtime linking)
less costly.

> If you reply "just statically link everything", I'm going to put you in my 
> spam filter.

We're talking about BB, not everything.

> Someday you may realize that the definition of "general purpose 
> tool" isn't "it does the one strange thing you want to do, and everything 
> else is broken".  (Nor is "everybody who doesn't do it my way is stupid" a 
> useful attitude.)

Huh? What does this have to do with anything I said?

> > > throw in the shared busybox lib and it all goes to hell ;)
> >
> > Also sounds like a very bad idea..
> 
> At present, I consider the shared busybox library useless.  I hope to get 
> standalone applet building merged in this dev cycle, but it's fifth or sixth 
> on the todo list.

I still wonder if PIC is worthwhile even in this case. Oh well. Not
relevant now anyway.

Rich



More information about the busybox mailing list