Fix dladdr detection.

Fixes #5717