home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / aix / 8966 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  2.4 KB

  1. Path: sparky!uunet!mcsun!uknet!daresbury!doc.ic.ac.uk!ibmassc!yktnews!admin!yktnews!prener
  2. From: prener@watson.ibm.com (Dan Prener)
  3. Newsgroups: comp.unix.aix
  4. Subject: Re: Help with nlist(), XCOFF, and memory architecture...
  5. Message-ID: <PRENER.92Aug20200654@prener.watson.ibm.com>
  6. Date: 21 Aug 92 01:06:54 GMT
  7. References: <PAVEL.92Aug15180402@pixel.SLAC.Stanford.EDU>
  8.     <PAVEL.92Aug19163010@pixel.SLAC.Stanford.EDU>
  9. Sender: news@watson.ibm.com (NNTP News Poster)
  10. Organization: IBM T.J. Watson Research Center, Hawthorne, New York
  11. Lines: 43
  12. In-Reply-To: pavel@pixel.SLAC.Stanford.EDU's message of 19 Aug 92 23:30:10 GMT
  13. Disclaimer: This posting represents the poster's views, not necessarily those of IBM
  14. Nntp-Posting-Host: prener.watson.ibm.com
  15.  
  16. In article <PAVEL.92Aug19163010@pixel.SLAC.Stanford.EDU> pavel@pixel.SLAC.Stanford.EDU (Tom Pavel) writes:
  17.  
  18.   [ . . . ]
  19.  
  20. >However, I still have many questions:
  21.  
  22. >- Where is all this function-descriptor stuff documented?  I scoured
  23. >through everything I could find, and I didn't see a trace of it (we're
  24. >still running 3.1.7, if that makes any diff in the docs).
  25.  
  26. Look in InfoExplorer under "linkage conventions" in the section on
  27. function pointers.
  28.  
  29. >- So far, what I can do works ok IF all the functions I want to
  30. >dynamically call are STATICALLY LINKED.  I can compute the text
  31. >address of the function code by adding 0x10000200 to the nlist value,
  32. >or by comparing the nlist value of ".main" with the text address in
  33. >its function descriptor.  
  34.  
  35. The second is better.  You don't know that your program will always
  36. be loaded at that address.
  37.  
  38.   [ . . . ]
  39.  
  40. >-  What is the TOC really, and how can I get its value for a given
  41. >memory segment?
  42.  
  43. The TOC is really a pool of address constants, put together by the linker.
  44. There is one per separately-linked object, not one per memory segment.
  45. All shared libraries are in a single segment.
  46.  
  47. >-  Finally, I still have no clue why IBM chose "." instead of "_" to
  48. >prepend to all global symbols...
  49.  
  50. If you have a global piece of data named "foo" then the global symbol is 
  51. "foo".  If you have a global function named "bar" then the name of the
  52. beginning of the program text is ".bar" but the name of the function
  53. descriptor is "bar".  That choice was made so that someone who wanted
  54. to import or export a function named "bar" would write the natural
  55. thing, namely that he was importing or exporting "bar" rather than some
  56. derived name.
  57. --
  58.                                    Dan Prener (prener@watson.ibm.com)
  59.