public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* How to relink an executable to be static?
@ 2004-11-18  6:34 David Braun
  2004-11-18 14:23 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: David Braun @ 2004-11-18  6:34 UTC (permalink / raw)
  To: binutils

Hi,

I'm the author of the Disk Encryption HOWTO and I'm getting ready to
write a significant update.  I'm looking for a tool to make the
encryption process as smooth as possible for my readers.

I've searched for a tool to suit my needs and so far haven't found one,
though I have found other people asking for it.  I've searched the
archive of this list and read the man pages of ld and gcc.  I'm open to
the idea that the answer is staring me in the face but I'm just too
dense to see it. :)

I want a tool that takes a dynamically linked executable and produces a
static version, e.g.:

	staticify /sbin/init /mnt/initrd/sbin/init

would take the libraries init depends on (/lib/tls/libc.so.6 &
/lib/ld-linux.so.2) and compile them into a standalone version of init
on the initial RAM disk.

I can recompile init from source and pass the -static flag, but I want
to be able to do this without requiring the source.  It seems to me this
should be easily achievable because staticify would have all the
information it needs.

I looked at prelink, which looks close to what I want, but not quite.

Is there a tool to do this?  Can I use an existing tool such as ld (or
set of tools such as binutils) to do this with appropriate flags?

David


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to relink an executable to be static?
  2004-11-18  6:34 How to relink an executable to be static? David Braun
@ 2004-11-18 14:23 ` Daniel Jacobowitz
  2004-11-18 19:03   ` David Braun
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2004-11-18 14:23 UTC (permalink / raw)
  To: David Braun; +Cc: binutils

On Wed, Nov 17, 2004 at 10:34:33PM -0800, David Braun wrote:
> Is there a tool to do this?  Can I use an existing tool such as ld (or
> set of tools such as binutils) to do this with appropriate flags?

No.  It seems like it should be possible, but you'd have to write a
custom tool for it.

-- 
Daniel Jacobowitz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to relink an executable to be static?
  2004-11-18 14:23 ` Daniel Jacobowitz
@ 2004-11-18 19:03   ` David Braun
  0 siblings, 0 replies; 3+ messages in thread
From: David Braun @ 2004-11-18 19:03 UTC (permalink / raw)
  To: binutils

On Thu, 2004-11-18 at 06:23, Daniel Jacobowitz wrote:
> On Wed, Nov 17, 2004 at 10:34:33PM -0800, David Braun wrote:
> > Is there a tool to do this?  Can I use an existing tool such as ld (or
> > set of tools such as binutils) to do this with appropriate flags?
> 
> No.  It seems like it should be possible, but you'd have to write a
> custom tool for it.

Ok, thank you.  I'll look into that.

David


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-18 19:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-18  6:34 How to relink an executable to be static? David Braun
2004-11-18 14:23 ` Daniel Jacobowitz
2004-11-18 19:03   ` David Braun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).