Martin,

Objdump is a new one; I found readelf, which with the --symbols option seems to 
do the job, though the names look a little more C++ decorated.  That loud thump 
(by the time it reached your location) you just heard was me slapping my head 
over missing /lib.

Many thanks!

Bill



-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Martin McClure
Sent: Wednesday, October 28, 2009 3:12 PM
To: [email protected]
Subject: Re: [Pharo-project] Linux FFI question: library given function name?

Schwab,Wilhelm K wrote:
> That seems to work.  I found a similar looking script that did not.  
> So far, it's sending me to a static library that I have yet to 
> associate with anything that FFI can load, but it's progress.

I'm not an expert in this field, but I've gone fishing for similar things 
before. Here's what I did this time...

There's a man page for syslog in sections 2 and 3. The syslog (2) man page 
(which is for the system call, I think not what you want) references "the C 
library function syslog()" which I think *is* probably what you're looking for.

The fact that it says it's a C library function leads me to believe that it 
might be in libc, where a lot of this really fundamental stuff hides. 
So I look in /lib to see what libc*.so files there are, find /lib/libc-2.9.so, 
and try:

  objdump -T /lib/libc-2.9.so | grep syslog

which prints this:
00000000000ccff0 g    DF .text  0000000000000098  GLIBC_2.2.5 syslog
00000000000ccf60 g    DF .text  000000000000008b  GLIBC_2.4   __syslog_chk
00000000000ccf50 g    DF .text  0000000000000010  GLIBC_2.2.5 vsyslog
00000000000cc960 g    DF .text  00000000000005e2  GLIBC_2.4   __vsyslog_chk

I suspect this is what you're looking for.

Using nm on .so files reports that there are no symbols, so it's probably 
better to use objdump.

Regards,

-Martin

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to