[llvm-readobj] Respect the exception directory when dumping ARM unwind info (#241557)
For ARM and ARM64 PE images, `llvm-readobj --unwind` decoded every
8-byte entry in each section whose name starts with .pdata. In a linked
image, however, the extent of the function table is given by the
exception directory, and the .pdata section can contain other data,
e.g. when another section is merged into it with /merge. That data was
decoded as RUNTIME_FUNCTION entries, which could lead to a fatal
".xdata must be at least 8 bytes in size" error on a valid image.
If the image has a non-empty exception directory that starts inside the
section being dumped, only decode the entries it covers. The directory
doesn't have to start at a multiple of the entry size within the section
(e.g. it can be 4-byte aligned after other merged data), so the entries
are addressed by their offset in the section rather than by an index.
Object files, and images without such a directory, are handled as
before.
The x86-64 dumper (Win64EHDumper) also walks .pdata without consulting
the exception directory. That is left unchanged here.
Fixes #230868.
Assisted-by: Claude Code