public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Brian Dessent <brian@dessent.net>
To: "Thomas Köppe" <t.koeppe@ed.ac.uk>
Cc: gcc-help@gcc.gnu.org, Tom Browder <tom.browder@gmail.com>
Subject: Re: Extract static object from dynamic one
Date: Tue, 04 Dec 2007 14:19:00 -0000	[thread overview]
Message-ID: <475561DA.E786BB0C@dessent.net> (raw)
In-Reply-To: <47555F19.1060501@ed.ac.uk>

Thomas Köppe wrote:

> Is there an obstruction in principle (that some vital information is
> lost in the shared library), or is it simply that no such tool has been
> written?

It's not just a matter of extracting something.  You'd have to rewrite
all accesses through the GOT and PLT (for ELF) or indirections through
.idata (for PE) to be regular symbol references.  You'd have to undo
relocs and make them into regular labels.  With things like relaxation
this becomes extremely nontrivial.  In a sense this is going backwards,
like a disassembler, because a static library is just a collection of
unlinked .o files, whereas a shared library is fully linked.

Brian

  reply	other threads:[~2007-12-04 14:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-03 23:22 Thomas Köppe
2007-12-04 11:58 ` Tom Browder
2007-12-04 13:05   ` Brian Dessent
2007-12-04 14:08     ` Thomas Köppe
2007-12-04 14:19       ` Brian Dessent [this message]
2007-12-04 16:13         ` Ian Lance Taylor
2007-12-04 14:47 Duft Markus
2007-12-04 15:06 ` Thomas Köppe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=475561DA.E786BB0C@dessent.net \
    --to=brian@dessent.net \
    --cc=gcc-help@gcc.gnu.org \
    --cc=t.koeppe@ed.ac.uk \
    --cc=tom.browder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).