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