Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* any utilities to work with shared libraries?
@ 1994-11-07 23:10 Ron Young
  1994-11-11 15:39 ` Paul Southworth
  0 siblings, 1 reply; 3+ messages in thread
From: Ron Young @ 1994-11-07 23:10 UTC (permalink / raw)



        Does anyone know if there are any utilities to allow me to replace
        routines in an existing shared library? Under sunos you could do
        this by using the x option of ar.

        According to the manual, you use the -shared and -no_archive
	options to ld to build shared libs, but I haven't been able
	to find anything that will allow you to extract/replace routines
	in an existing shared library.

	If it makes any difference, I want to be able to replace a couple
	of routines in libc.so.

	Thanks

	-ron young



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

* Re: any utilities to work with shared libraries?
  1994-11-07 23:10 any utilities to work with shared libraries? Ron Young
@ 1994-11-11 15:39 ` Paul Southworth
  1994-11-11 20:57   ` Rick Murphy
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Southworth @ 1994-11-11 15:39 UTC (permalink / raw)


In article <39mc5o$6fj@news.nevada.edu>, Ron Young <ron@nevada.edu> wrote:
>        Does anyone know if there are any utilities to allow me to replace
>        routines in an existing shared library? Under sunos you could do
>        this by using the x option of ar.

Your memory serves you ill.  Under SunOS you got a *static* library
that contained *shared* objects, in /usr/lib/shlib.etc, and you did
an "ar x" on that to get the goodies out and then build a new
shared library.  But under SunOS, you still can't extract objects
from an existing *shared* library:

% ar x /usr/lib/libc.so.1.8
ar: /usr/lib/libc.so.1.8 not in archive format

>        According to the manual, you use the -shared and -no_archive
>	options to ld to build shared libs, but I haven't been able
>	to find anything that will allow you to extract/replace routines
>	in an existing shared library.

There aren't any.

>	If it makes any difference, I want to be able to replace a couple
>	of routines in libc.so.

What you need is a set of shared objects under OSF/1 that can be used to
generate a new shared library.  As far as I know, this is not available
to you under OSF/1.

--
Paul Southworth
CICNet Systems Support
pauls@cic.net


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

* Re: any utilities to work with shared libraries?
  1994-11-11 15:39 ` Paul Southworth
@ 1994-11-11 20:57   ` Rick Murphy
  0 siblings, 0 replies; 3+ messages in thread
From: Rick Murphy @ 1994-11-11 20:57 UTC (permalink / raw)



One (possible) way to do what you want is to use a replacement library -
link your new routines in a different shared object, let's say "replace.so".
Then, use the loader arguments to force your routines to be used.
For example, the "malloc_dbg" package has the following instructions:
[btw: I'm not the author of this - Dave Hill (ddhill@zk3.dec.com) wrote this
information. Credit where credit is due.]

The OSF1/AXP shared library loader has the capabilities to override the
shared libraries used, even to the extent that it takes symbols from a
library that the program was not linked with.  Using this technique, you
may override the standard malloc in libc with the debug malloc shared
library.

        _RLD_LIST=/path_to_the_dir/libmalloc_dbg.so:DEFAULT;export _RLD_LIST

Remember though, setting this variable will affect ALL commands invoked
from the shell that it is set inside of.  You may wish to do this inside
of a shell script that sets the variable just before starting your
program.  Another option with sh and ksh is to list the environment
variables on the program invocation line, for example:

         _RLD_LIST=/path_to_the_dir/libmalloc_dbg.so:DEFAULT program

This command will set the specified env variable and then run program.
-- 
Rick Murphy, WA1SPT/4			Washington Federal Programs Office
Domain:  murphy@dco.dec.com		 Technical Support Group
Bang:    decwrl!burfle.enet!murphy	This posting expresses MY opinions only;
Ding:    301-306-2040.			 I do not speak for Digital.


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

end of thread, other threads:[~1994-11-11 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-11-07 23:10 any utilities to work with shared libraries? Ron Young
1994-11-11 15:39 ` Paul Southworth
1994-11-11 20:57   ` Rick Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox