Re: dladdr/backtrace_symbols return incorrect symbol names
Re: dladdr/backtrace_symbols return incorrect symbol names
- Subject: Re: dladdr/backtrace_symbols return incorrect symbol names
- From: Steve Checkoway <email@hidden>
- Date: Tue, 24 Mar 2009 19:11:48 -0700
On Mar 24, 2009, at 9:51 AM, Ethan Tira-Thompson wrote:
It's clear what is happening is dladdr is skipping all of the
't' (local text section?) symbols, and only returning the
'T' (external text section?) symbols. Spot checking the correctly
returned symbols suggests they are all 'T' symbols. I'm guessing
the 't' symbols are static-linked in the executable, and 'T' symbols
are dynamically loaded from a build directory somewhere, and thus
dladdr is only reporting the 'T' symbols as it ignores static linkage.
Does that sound right?
Yeah.
Alternatively, I suppose I could figure out what nm is using and
emulate that in my code... sounds even more hairy than popen atos
though, probably a bunch of manual mach-o parsing...?
I've posted code to this list (or maybe xcode-users or unix-porting)
that pretty much does what Terry suggested in one of his replies:
playing with LC_DYSYMTAB. It gets the address of noninlined static
symbols as long as you don't strip the symbol names.
--
Steve Checkoway
"Anyone who says that the solution is to educate the users
hasn't ever met an actual user." -- Bruce Schneier
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden