[DWARFLinker] Share hashFullyQualifiedName between the linkers (#240621)
The classic linker hangs computing the Apple accelerator table hash of
a type whose DW_AT_specification or DW_AT_abstract_origin chain forms a
cycle or holds a reference it cannot resolve. Its loop has no bound,
and on an unresolved reference it retries the same DIE forever.
The parallel linker's copy bounds the walk with finiteLoop. Move it to
Utils and use it from both linkers, each with its own reference
resolver. The test links a type whose DW_AT_specification refers to
itself, which hangs the classic linker without this change.
The parallel linker now also ends the name at any unit DIE, not only a
DW_TAG_compile_unit, as the classic linker already did. The classic
linker still ends it at a DW_TAG_module scope. Hashes are otherwise
unchanged.
Assisted-by: Claude