home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / linux / 22804 < prev    next >
Encoding:
Text File  |  1993-01-05  |  4.4 KB  |  84 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!uwm.edu!psuvax1!atlantis.psu.edu!wintermute.phys.psu.edu!ra!tantalus.nrl.navy.mil!eric
  3. From: eric@tantalus.nrl.navy.mil (Eric Youngdale)
  4. Subject: Re: Old Libc, can it be tossed?
  5. Message-ID: <C0E7zB.8xL@ra.nrl.navy.mil>
  6. Sender: usenet@ra.nrl.navy.mil
  7. Organization: Naval Research Laboratory
  8. References: <1993Jan3.131543.17102@camaro.uucp> <Jan.4.00.08.56.1993.29115@geneva.rutgers.edu> <1993Jan5.140207.29191@klaava.Helsinki.FI>
  9. Date: Tue, 5 Jan 1993 18:13:59 GMT
  10. Lines: 72
  11.  
  12. In article <1993Jan5.140207.29191@klaava.Helsinki.FI> kankkune@klaava.Helsinki.FI (Risto Kankkunen) writes:
  13. >>>Can the older libc.so.4.0 & libc.so.4.1 be deleted if you have libc.so.4.2?
  14. >>>Also, do I have to link libc.so.4.2 to libc.so.4.1 & 4.0 if I do?
  15. >>
  16. >>The copy of tcsh I have, which seems to be the most recent, explicitly
  17. >>asks for libc.so.4.1.  If you make it a copy of libc.so.4.2, tcsh
  18. >>complains that it's incompatible.  Other than tcsh, I think most
  19. >>programs use the symlink libc.so.4, and so wouldn't care if 4.1 is
  20. >>gone.
  21. >
  22. >I've had a little pause with linux and just beginning to hack with it
  23. >again. I notice there are now shared libraries, and even in two flavors,
  24. >I gather. Haven't seen any good explanations of how they work, though. I
  25. >hope this hasn't been beaten to death here already or buried into the
  26. >FAQ somewhere.
  27.  
  28.     OK, you asked for it :-).
  29.  
  30.  
  31. >What's the bussiness with jump tables? I think jump tables refer to
  32. >indirect addressing so that you can have fixed entry points to libraries
  33. >while still be able to change the implementation. Why is there the other
  34. >alternative, and is it still supported?
  35.  
  36. The kernel reserves the address space from 0x60000000 to 0xc0000000 for shared
  37. libraries and each library is assigned an address ahead of time.  At the start
  38. of each shared library is basically a series of jump instructions and these
  39. jump off to each of the routines within libc.  When there is an upgrade to
  40. libc, the jump instructions remain at the same address even though the actual
  41. functions move around as required.
  42.  
  43. Before we had the jump tables, programs were linked in such a way that you
  44. would call the function directly.  The problem with this was that you had to
  45. relink when you went to a new version of the library.  These are called
  46. "Classic" libraries, and are still supported and used (X11 libraries for
  47. example).  X was too hard to jumpify and the libraries change fairly
  48. infrequently so at the time it was decided that X remain a classic library.
  49. The next version of the X libraries may yet be a jumptable library in some form
  50. or another.
  51.  
  52. >What is the shared library resolution mechanism? I would think that at
  53. >run time the the library with matching major number and highest minor
  54. >number would be selected. Seeing people link and copy the libraries to
  55. >different names and having had problems with programs that required 4.1,
  56. >not 4.2, it seems this isn't the case. Why? What's the use of jump
  57. >tables, if you cannot use old programs with newer libraries? How do I
  58. >know, if a new library is compatible with an older one (modulo bugs)? Is
  59. >there some internal version number in the library, or is it all in the
  60. >name?
  61.  
  62.     Each library reference contains a couple of bits of info.  First of all
  63. there is a filename that will be opened and is assumed to contain the library.
  64. Secondly, the version number of the library that the program was linked to is
  65. also stored.  At startup time, the startup code verifies that the major number
  66. is the same, and that the minor number is >= the minor number of the library
  67. that the program was linked to.  If there are changes in the library that would
  68. make it impossible to have binary compatibility, then the major number should
  69. have been incremented and the minor number should be reset to 1 (0?).  The
  70. filename to be opened is usually in the form /lib/libc.so.4 in the case of
  71. libc, and standard usage is that libc.so.4 be a symlink or a copy of the
  72. version of libc that you want to use.
  73.  
  74.     If there are images out there that explicitly ask for /lib/libc.so.4.1
  75. instead of /lib/libc.so.4, then I think that this is in error.  The image was
  76. probably linked to some prototype version of libc before the final release.
  77.  
  78.     It turned out that there were some changes in libc 4.2 to regex which
  79. broke sed, recompiling sed seemed to fix the problem.
  80.  
  81. -Eric
  82. -- 
  83. Eric Youngdale
  84.