Factor out some functions from parse_archive_units.