The Archive object created when loading an archive specified with wholearchive got cleaned up immediately, when the owning std::unique_ptr went out of scope, even if persisted StringRefs pointed to memory that belonged to the archive, which no longer was mapped in memory.
This hasn't been an issue with regular (as opposed to thin) archives, as references to the member objects has kept the mapping for the whole archive file alive - but with thin archives, all such references point to other files.
Add the std::unique_ptr to the arena allocator, to retain it as long as necessary.
This fixes (the last issue raised in) PR42388.
@hans I think this should be a safe backport once it lands.