Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Dec 2005 11:18:26 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Ceri Davies <ceri@submonkey.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Mostly static binaries with crunchgen
Message-ID:  <200512211118.27363.jhb@freebsd.org>
In-Reply-To: <20051221094130.GB20540@submonkey.net>
References:  <20051220114121.GA58620@submonkey.net> <200512201641.02898.jhb@freebsd.org> <20051221094130.GB20540@submonkey.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 21 December 2005 04:41 am, Ceri Davies wrote:
> On Tue, Dec 20, 2005 at 04:41:01PM -0500, John Baldwin wrote:
> > On Tuesday 20 December 2005 04:31 pm, Ceri Davies wrote:
> > > On Tue, Dec 20, 2005 at 01:43:58PM -0500, John Baldwin wrote:
> > > > On Tuesday 20 December 2005 10:58 am, Ceri Davies wrote:
> > > > > On Tue, Dec 20, 2005 at 10:29:27AM -0500, John Baldwin wrote:
> > > > > > The other concern is does this force the entire crunch to require
> > > > > > a working rtld now?  If so, that would mean that this wouldn't be
> > > > > > appropriate for something such as /rescue.  If there were a way
> > > > > > to statically link rtld into the crunch itself that would
> > > > > > probably be ideal, but I'm not sure that is possible.
> > > > >
> > > > > No, just the dynamic bits require rtld.
> > > >
> > > > So you can still run /foo without rtld being present if foo doesn't
> > > > need dlopen, etc.?  It looks like you link the crunch with -o
> > > > dynamic, so isn't the kernel going to complain when you try to exec
> > > > it that it can't find rtld if rtld is missing?  (Think about /rescue
> > > > if your rtld is hosed and/or missing.)
> > >
> > > Sorry, you're correct of course.  It's still useful in Adrian's
> > > environment at least (because he puts rtld on an MFS).
> >
> > One workaround for this case would be to have two crunches, one for the
> > pure-static stuff and one for the dynamic-using stuff.  Alternatively, if
> > you had a way to statically link the rtld functions into the crunch you
> > could still use just one crunch.  I just want to make sure we don't go
> > turning this on for /rescue since that needs to work if rtld is hosed
> > (unless we go the route of two crunches).
>
> Ah, OK.  The new version attached ensures that if you don't use the
> libs_so declaration, you get an identical binary to that produced without
> the patch.

Sounds good (you could just go back to using -static in that case, but that's 
a minor detail).  Still have TORTUOUS change in your diff. :)

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512211118.27363.jhb>