rtld: Sync 1/7 - Handle premature symlook_obj call
authorJohn Marino <draco@marino.st>
Wed, 12 Jun 2013 10:49:17 +0000 (12:49 +0200)
committerJohn Marino <draco@marino.st>
Thu, 13 Jun 2013 11:12:07 +0000 (13:12 +0200)
commit9066fe90d0cfacdcc68ac4e33a768ae24a149519
tree80f5cb21bc17c2759d267b416783e350bd6f0dc9
parent93f3933ac3e2ad37a7ba775663c711b13588f147
rtld: Sync 1/7 - Handle premature symlook_obj call

It doesn't appear that this code is needed for x86 platforms as this
case should already be caught in early code, but it doesn't hurt
DragonFly to handle every possible case.

  Work around a situation where symlook_obj() could be called for the
  object for which digest_dynamic1() was not done yet.  Just return
  EINVAL and do not try to dereference NULL buckets hash array.

  This seems to happen on ia64 for rtld object itself where the
  R_IA_64_FPTR64LSB relocations require symbol lookup.  The dynamic
  linker itself does not rely on identity of the C-level function
  pointers (i.e. function descriptors).

Taken verbatim from:
FreeBSD SVN 235054 (05 MAY 2012)
libexec/rtld-elf/rtld.c