home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / aix / 12957 < prev    next >
Encoding:
Text File  |  1993-01-03  |  1.7 KB  |  35 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!milano!cactus.org!chukran
  3. From: chukran@cactus.org (Rudy E. Chukran)
  4. Subject: Re: Shared libraries: the -bM: option to ld
  5. Message-ID: <1993Jan3.230839.1300@cactus.org>
  6. Organization: Capital Area Central Texas UNIX Society, Austin, Tx
  7. References: <C00Bnq.29q@unixhub.SLAC.Stanford.EDU>
  8. Date: Sun, 3 Jan 1993 23:08:39 GMT
  9. Lines: 24
  10.  
  11. In article <C00Bnq.29q@unixhub.SLAC.Stanford.EDU> ALHY@slac.stanford.edu writes:
  12. >Can somebody give a detailed explanation of the -bM: option to ld?  I
  13. >wanted to have a shared object that had a static (file-scope) variable
  14. >such that
  15.     text deleted ...
  16. >Now, if I do this, the behavior is completely determined (as far as I
  17. >can tell) by what my -bM: option is on the second step of the link
  18. >(where I link in the c libraries):  If it's shared (1L or RE), the
  19. >desired behavior occurs.  If it's not shared (again, either 1L or RE),
  20. >the desired behavior doesn't occur (both calls reference the same
  21. >memory location).  This seems to be independent of the -bM: option
  22. >that I compile with!!!
  23. First of all, shared objects means shared amongst other processes. It has
  24. no meaning about any data objects being shared. Within a process a symbol
  25. resolves to a single address. Period.
  26.  
  27. Between processes, it depends:
  28. If the symbol is text, and the object is in a shared module, then each processes
  29. address for that symbol is the same. HOwever, if the symbol is data, then each
  30. process gets its own copy in its own address space.
  31.  
  32. If you want static scope data , then you can only get it by specifying
  33. static declarations as defined by the C language. Linker directives will not
  34. get you there.
  35.