home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!unixhub!pixel.SLAC.Stanford.EDU!pavel
- From: pavel@pixel.SLAC.Stanford.EDU (Tom Pavel)
- Newsgroups: comp.unix.aix
- Subject: Help with nlist(), XCOFF, and memory architecture...
- Message-ID: <PAVEL.92Aug15180402@pixel.SLAC.Stanford.EDU>
- Date: 16 Aug 92 01:04:02 GMT
- Sender: news@unixhub.SLAC.Stanford.EDU
- Organization: Stanford Linear Accelerator Center
- Lines: 35
- Nntp-Posting-Host: pixel.slac.stanford.edu
-
-
- I'm trying to implement a dynamic function call mechanism (you find
- out the name of the function at run-time, look it up in the symbol
- table, and call the right address). On my Sun, this worked very
- trivially: an nlist() call returns the symbol table value for the
- function, which happened to be the C-callable address of the function.
- Of course, this is not quite so trivial on an RS/6000....
-
- I've scoured the available documentation around here, and I've learned
- a bit, although I must say I still don't understand XCOFF completely
- (I don't understand COFF either, so that's ok). I have verified that
- nlist() does return the number that's in the symbol table.
- Unfortunately, that number is not the "address of the function" in the
- sense that I'm interested in.
-
- Ok. So I learned about the memory segments, and understand that all
- the text symbols start with 0x10000000. I'm still off by a little
- bit. I thought of using _text for the offset; still no good. I even
- thought I'd be real clever and figure out the offset by comparing the
- nlist value for .main with &main; that still didn't work.
-
- Anyone with any suggestions? I know there's some segment offset, if
- only I could find the value of it... What good is an nlist() that
- doesn't really return the address of the symbol?
-
- While I'm on a roll.... How come all the global symbols start with
- "." instead of "_"? Any earthly reason?
-
- Thanks for any leads...
-
-
- Tom Pavel
-
- Stanford Linear Accelerator Center
- pavel@pixel.slac.stanford.edu
-