readelf: Define dyn_mem outside the while loop.