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

  1. Path: sparky!uunet!stanford.edu!unixhub!pixel.SLAC.Stanford.EDU!pavel
  2. From: pavel@pixel.SLAC.Stanford.EDU (Tom Pavel)
  3. Newsgroups: comp.unix.aix
  4. Subject: Help with nlist(), XCOFF, and memory architecture...
  5. Message-ID: <PAVEL.92Aug15180402@pixel.SLAC.Stanford.EDU>
  6. Date: 16 Aug 92 01:04:02 GMT
  7. Sender: news@unixhub.SLAC.Stanford.EDU
  8. Organization: Stanford Linear Accelerator Center
  9. Lines: 35
  10. Nntp-Posting-Host: pixel.slac.stanford.edu
  11.  
  12.  
  13. I'm trying to implement a dynamic function call mechanism (you find
  14. out the name of the function at run-time, look it up in the symbol
  15. table, and call the right address).  On my Sun, this worked very
  16. trivially: an nlist() call returns the symbol table value for the
  17. function, which happened to be the C-callable address of the function.
  18. Of course, this is not quite so trivial on an RS/6000....
  19.  
  20. I've scoured the available documentation around here, and I've learned
  21. a bit, although I must say I still don't understand XCOFF completely
  22. (I don't understand COFF either, so that's ok).  I have verified that
  23. nlist() does return the number that's in the symbol table.
  24. Unfortunately, that number is not the "address of the function" in the
  25. sense that I'm interested in.
  26.  
  27. Ok.  So I learned about the memory segments, and understand that all
  28. the text symbols start with 0x10000000.  I'm still off by a little
  29. bit.  I thought of using _text for the offset; still no good.  I even
  30. thought I'd be real clever and figure out the offset by comparing the
  31. nlist value for .main with &main; that still didn't work.
  32.  
  33. Anyone with any suggestions?  I know there's some segment offset, if
  34. only I could find the value of it...   What good is an nlist() that
  35. doesn't really return the address of the symbol?
  36.  
  37. While I'm on a roll....  How come all the global symbols start with
  38. "." instead of "_"?  Any earthly reason?
  39.  
  40. Thanks for any leads...
  41.  
  42.  
  43. Tom Pavel
  44.  
  45. Stanford Linear Accelerator Center
  46. pavel@pixel.slac.stanford.edu
  47.