bfd: pe: Revise pdata sorting conditional
Correctly sort PE .pdata sections for architectures that support it.
This patch revises the conditional logic for sorting the .pdata section in PE files. Historically, sorting was limited to x86_64, which is seen as an oversight as the PE specification mandates sorting for all relevant architectures. The change rewrites the condition to positively identify architectures that support .pdata sorting, addressing potential issues for architectures like ia64 and others where it might have been incorrectly disabled.
In Details
This patch refactors the conditional that enables sorting of the .pdata section in bfd/peXXigen.c. The original condition was negative and limited to specific architectures (x86_64, AArch64, LoongArch64, RiscV64), potentially missing other PE32 architectures that should have this sorting. The rewrite aims to correctly identify architectures where .pdata sorting is applicable, aligning with the PE specification's requirements and fixing potential oversights for platforms like ia64.
- .pdata section
- A section in PE files containing runtime function lookup information, used for exception handling and debugging. It requires specific sorting.
- PE specification
- The document defining the structure and conventions of the Portable Executable (PE) file format, used for executables, object code, and shared libraries on Windows.
- ia64
- Intel Itanium Architecture, a 64-bit instruction set architecture.