public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* -rdynamic and -static
@ 2002-04-10  6:24 Stéphane Doyon
  2002-04-10  9:15 ` H . J . Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Stéphane Doyon @ 2002-04-10  6:24 UTC (permalink / raw)
  To: binutils; +Cc: Stéphane Doyon

Hello,

[Please Cc me as I am not subscribed.]

Our software has modules that are implemented as shared libraries. But
now there's a situation where we need it to be statically linked, and we
can't figure out how to get it to work.

The software is called BRLTTY; it drives braille displays. There is a
central module that implements screen review functions, and there are
several driver modules, one for each supported braille display model. The
driver modules are implemented as shared libraries, so we can choose at
run-ttime which one to use.

Now we want to make an accessible boot diskettes / distribution
installation diskettes. We link our main BRLTTY module statically,
because we don't have a sufficiently small libc and friends.

Our problem is that our driver libraries reference symbols from the main
program, and from libc. Yet these symbols are no longer listed in the ELF
headers of the executable when it is linked with -static and therefore we
get "undefined symbol" errors when we dlopen our driver libraries.

I'm no ELF expert and I'm not really familiar with linker scripts. I've
read what I could of the manuals, and asked several fairly knowledgeable
friends, but I couldn't figure out how to do it. Can anyone help?

Can we:
-Somehow build a specialized shared lib with just the part of libc that
we need?
-Or have the ELF headers of our executable list all the symbols it
contains?
-Or somehow explicitly export the symbols we need in our shared libs?

Thanks for any hints.

[Please Cc me as I am not subscribed.]

-- 
Stéphane Doyon
<s.doyon@videotron.ca>
http://pages.infinit.net/sdoyon/

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

* Re: -rdynamic and -static
  2002-04-10  6:24 -rdynamic and -static Stéphane Doyon
@ 2002-04-10  9:15 ` H . J . Lu
  2002-04-11  7:13   ` Stéphane Doyon
  0 siblings, 1 reply; 3+ messages in thread
From: H . J . Lu @ 2002-04-10  9:15 UTC (permalink / raw)
  To: Stéphane Doyon; +Cc: binutils

On Wed, Apr 10, 2002 at 09:24:19AM -0400, Stéphane Doyon wrote:
> Hello,
> 
> [Please Cc me as I am not subscribed.]
> 
> Our software has modules that are implemented as shared libraries. But
> now there's a situation where we need it to be statically linked, and we
> can't figure out how to get it to work.
> 
> The software is called BRLTTY; it drives braille displays. There is a
> central module that implements screen review functions, and there are
> several driver modules, one for each supported braille display model. The
> driver modules are implemented as shared libraries, so we can choose at
> run-ttime which one to use.
> 
> Now we want to make an accessible boot diskettes / distribution
> installation diskettes. We link our main BRLTTY module statically,
> because we don't have a sufficiently small libc and friends.
> 

Are you using glibc? You can customize my sglibc to strip out stuffs
you don't need. You may get glibc down to about 500KB or less.



H.J.

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

* Re: -rdynamic and -static
  2002-04-10  9:15 ` H . J . Lu
@ 2002-04-11  7:13   ` Stéphane Doyon
  0 siblings, 0 replies; 3+ messages in thread
From: Stéphane Doyon @ 2002-04-11  7:13 UTC (permalink / raw)
  To: H . J . Lu; +Cc: binutils, Stéphane Doyon

On Wed, 10 Apr 2002, H . J . Lu wrote:

> On Wed, Apr 10, 2002 at 09:24:19AM -0400, Stéphane Doyon wrote:
> > Hello,
> > 
> > [Please Cc me as I am not subscribed.]
> > 
> > Our software has modules that are implemented as shared libraries. But
> > now there's a situation where we need it to be statically linked, and we
> > can't figure out how to get it to work.
> > 
> > The software is called BRLTTY; it drives braille displays. There is a
> > central module that implements screen review functions, and there are
> > several driver modules, one for each supported braille display model. The
> > driver modules are implemented as shared libraries, so we can choose at
> > run-ttime which one to use.
> > 
> > Now we want to make an accessible boot diskettes / distribution
> > installation diskettes. We link our main BRLTTY module statically,
> > because we don't have a sufficiently small libc and friends.
> > 
> 
> Are you using glibc? You can customize my sglibc to strip out stuffs
> you don't need. You may get glibc down to about 500KB or less.

I'll keep that in mind, but I really was hoping we wouldn't have to go 
into glibc customization... Where can I find it BTW, the links that google 
found seem to all be broken?

I also tried mklib.sh from the Debian bootdisk package. It did shrink the 
libs a lot but in the end they were still 1.6MB, while the statically 
linked main module is only about 550KB (which still seems bloated).

-- 
Stéphane Doyon
<s.doyon@videotron.ca>
http://pages.infinit.net/sdoyon/

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

end of thread, other threads:[~2002-04-11 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-10  6:24 -rdynamic and -static Stéphane Doyon
2002-04-10  9:15 ` H . J . Lu
2002-04-11  7:13   ` Stéphane Doyon

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).