Do not apply properties to arch-allocated types

A user reported that gdb would crash when debugging a certain Fortran
executable.

The bug is that the DWARF reader may try to apply dynamic properties
to an arch-allocated type.  This came as a bit of a surprise, but the
issue is that the function-type-allocation code could end up creating
an arch-owned type, when the return type is arch-owned.

This patch fixes the problem, and any other potential future problems,
by arranging for all types created by the DWARF reader to be
objfile-owned.

A better long-term solution might be the fabled "type GC", where the
arch/objfile distinction is finally removed.  However, this is more
difficult to implement.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32793
5 files changed