Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 26 Aug 2012 17:46:45 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: dladdr patch status

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.