mailing list of musl libc
 help / color / mirror / code / Atom feed
* dladdr patch status
@ 2012-08-26 21:46 Rich Felker
  2012-08-26 23:23 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Rich Felker @ 2012-08-26 21:46 UTC (permalink / raw)
  To: musl

I want to go ahead with merging Boris's dladdr patch; the main
question that remains is how to handle getting the symbol table
length. For ELF hash it's easy; the hash table contains the symbol
table length at the beginning. But for GNU-hash-only files, the length
is never stored and the number of symbols intended to be visible can
only be measured by a linear pass across the GNU hash table. This is
no so bad in big-O terms since dladdr is already O(n) where n is the
number of symbols, but it's rather ugly code and still probably has a
moderate performance cost.

The only alternative I see so far is using the _section_ header
information to determine the symbol table size. This should work for
either GNU or standard ELF hash, without any specialized code, but
it's not clear at all to me that section headers are required to exist
at runtime. They almost surely exist in .so files since "ld" needs
them to link programs or other libraries against the .so file and in
practice they exist in the main program unless you've done nasty
things to the ELF file to remove them, so it's probably okay...

Thoughts?

Rich


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: dladdr patch status
  2012-08-26 21:46 dladdr patch status Rich Felker
@ 2012-08-26 23:23 ` Rich Felker
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2012-08-26 23:23 UTC (permalink / raw)
  To: musl

On Sun, Aug 26, 2012 at 05:46:45PM -0400, Rich Felker wrote:
> The only alternative I see so far is using the _section_ header
> information to determine the symbol table size. This should work for

Except that there may not be a reliable way to even FIND the section
headers, or ensure that they're mapped into memory, just because
they're in the file. Thus, this seems like it might be a dead-end..

Rich


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-26 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-26 21:46 dladdr patch status Rich Felker
2012-08-26 23:23 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).