rtld: Fix gethints()
authorJohn Marino <draco@marino.st>
Mon, 7 May 2012 15:56:36 +0000 (17:56 +0200)
committerJohn Marino <draco@marino.st>
Mon, 7 May 2012 22:14:30 +0000 (00:14 +0200)
commit1ff8a2bd3eb6e5587174c6a983303ea3a79e0002
treec2d219ce90660a84cc08ae76b5ad40618dd464ec
parent34d6d83ea4ee0a557fcefac2945a2058b53e6a27
rtld: Fix gethints()

The function that retrieves the hints file contents had a logic flaw.
It's supposed to return either the full or filtered version of the
hints file depending if the object has the nodefaultlib flag set or
not.  The problem was that every subsequent call would return the
first call's result regardless of the nodefaultlib flag setting.

The function's API was changed to simplify the code.  The function is
never called without a valid object, so there was no need to test for
that in order the check the nodefaultlib flag.  Now the flag is passed
to gethints() directly.

Reported and submitted by: Konstantin Belousov
libexec/rtld-elf/rtld.c