readelf: When the version chain ends, stop processing the entries.

The version definition, auxiliary version, version dependency and needed
version sections chain information together through "next" fields. When
the "next" field is zero there are no more information entries. Stop
processing when we see zero instead of repeatedly processing the same
entry (at offset zero from the current one).

Signed-off-by: Mark Wielaard <mjw@redhat.com>
2 files changed