This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

DT_GNU_HASH latest patches


On Thu, Jul 06, 2006 at 01:25:35PM +0200, Jakub Jelinek wrote:
> Will now do a few small changes suggested by Uli late last night and then
> post the final patches.  I don't want to make nbuckets a power of two,
> the division really isn't very expensive on contemporary CPUs and we don't
> want multiple of 32 nbuckets for the bitmask trick to work properly.

And here are the hopefully final patches.

Changes today:
1) swapped chainoff and bitmask in the buckets array pairs - bitmask
   is accessed first by ld.so, so it makes sense to put it first
2) chainoff fields in the bucket array pairs don't contain indexes into
   the chains area of .gnu.hash section (located at
   .gnu.hash'VMA + 8 + 8 * nbuckets) but rather dynamic symbol indexes.
   So the chain location for CHAINOFF is:
   .gnu.hash'VMA + 8 + 8 * nbuckets + (CHAINOFF - symidx) * 4
   The advantage of this is that the bias can be applied once in the ld.so
   initialization of a library and the inner loop doesn't need to subtract
   or add it anywhere.
3) added hooks, so that executable PLT slots on i386/x86_64 where the
   executable never takes address of those functions (and thus the SHN_UNDEF
   PLT symbols have st_value == 0) are not added to .gnu.hash chains
4) if there are no symbols in the .gnu.hash section at all, the linker
   sets nbuckets to 0.  This will allow in the future to completely remove
   the executable from symbol search scope.

Ok for trunk?

	Jakub

Attachment: binutils-hash-style.patch
Description: Text document

Attachment: glibc-gnu-hash.patch
Description: Text document

Attachment: prelink-gnu-hash.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]