home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sgi / 12736 < prev    next >
Encoding:
Text File  |  1992-08-21  |  2.9 KB  |  63 lines

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