Improve readability and correctness of the OS specific libunwind bits.
Improve readability and correctness of the OS specific libunwind bits.

All of the access to __exidx_*, dl_iterate_phdr(), etc. is specific to
the findUnwindSections() function. Right now all of the includes and
declarations related to them are scattered throughout the source file.
For example, for <link.h>, we have a full list of operating systems
guarding the #include, even though the code that uses dl_iterate_phdr()
miraculously doesn't use the same list.

Change the code so that findUnwindSections() is preceded by a block of
#ifdefs that share the same structure as the function itself. First
comes all of the macOS specific bits, followed by bare-metal ARM,
followed by ELF EHABI + DWARF.

This actually allows us to build a copy of libunwind without any
specific ifdefs for NetBSD, CloudABI, etc. It likely also unbreaks the
build of libunwind on FreeBSD/armv6, though I can't confirm.

Reviewed by:	compnerd
Differential Revision:	https://reviews.llvm.org/D30696


git-svn-id: 62ef012455b6b8fcec9c41ca270ebf409aae1006@297174 91177308-0d34-0410-b5e6-96231b3b80d8

llvm-mirror/libunwind,llvm-mirror/libunwind,llvm-mirror/libunwind