home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!usc!sdd.hp.com!news.cs.indiana.edu!uceng.uc.edu!babbage.ece.uc.edu!tmcbraye
- From: tmcbraye@thor.ece.uc.edu (Tim McBrayer)
- Subject: Re: help with shared libraries
- Message-ID: <1992Aug21.163640.13254@babbage.ece.uc.edu>
- Originator: tmcbraye@thor.ece.uc.edu
- Sender: root@babbage.ece.uc.edu (Operator)
- Nntp-Posting-Host: thor.ece.uc.edu
- Organization: Unversity of Cincinnati, ECE Dept
- References: <32141@adm.brl.mil>
- Date: Fri, 21 Aug 1992 16:36:40 GMT
- Lines: 49
-
-
- In article <32141@adm.brl.mil>, justin@scs.leeds.ac.uk writes:
- |> Hi,
- |>
- |> I'm trying to make some of the my libraries into shared libraries since the
- |> executables they produce are getting a little too large for comfort. After
- |> fighting through "man 1 mkshlib" I got a small example library to work BUT :
- |>
- |> a) I can't the shared library to access routines outside itself (e.g. printf
- |> etc). When I run mkshlib with -v I see the 'ld' that causes this. Is there
- |> any way round this since lots of the libraries access further libraries and
- |> functions.
- Yep, this is all taken care of for you (sort of). First of all, the best
- reference for this is the IRIX Programmer's Guide, Chapter 13 (or 14?).
- It details all you need to know about how shlibs are accessed, why to use them,
- how to optimize them, and how to access external signals. It's a little
- awkward to do, but the Programmer's Guide has fairly thorough instructions, as
- well as a complete example of how to modify your code to work in a shared lib.
- I don't have access to manuals right now, but if you don't have said document
- I can post/email the procedure.
-
- |> b) I'm a little concerned about choosing memory addresses out of mid-air for
- |> the shared library. I've read the NOTES section and obeyed but I wondered if
- |> anybody had practical advice/horror stories to give on the subject.
- |>
- IF you give it a moment's thought, you'll see that the amount of memory
- space we're talking about is *HUGE*. SGI suggests putting the two segments at
- 0x0b800000 and 0x0bc00000 (right?). These are 4 Meg segments, located way
- up in the program's virtual address space. 0x0b800000 is many hundreds of Megs
- up in the address space; no danger of running out of addresses! mkshlib
- handles all the jump tables and address mapping for you; there really is
- no worry about addressing. Just be sure that no two shared libs are mapped
- into the same space. Running odump -L <a.out> will tell you where a.out is
- expecting the shared libs it needs to be mapped to.
-
- |> c) Is what I'm trying to do sensible. Are IRIX shared libraries designed for
- |> this?
- This is exactly what the shared libraries are designed to do.
- |>
- |> Thanks in advance for any hints/suggestions/abuse
- |>
- |> Justin
- |>
- |> justin@scs.leeds.ac.uk
- Good Luck!
- --
- Tim McBrayer tmcbraye@thor.ece.uc.edu
- Computer Architecture Design Laboratory (513) 556-0904
- University of Cincinnati "Visualize Whirled Peas"
-