Check for dynamic symbols when doing smart re-linking.

By default, nm lists the symbols from the normal symbol table, which get
removed when stripping. As a result, the current implementation fails
for release builds.

Change-Id: I922623fb24694340a675804ffa13057ce12c70f2
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>