COFF_WITH_pex64 and COFF_WITH_peAArch64 can't be true at the same time.
That means that two conditionals that control the sorting of the .pdata section
became a falsum.
The testsuite doesn't catch this because the linker does the sorting and to link
you require library support from the unwinder so we can't test from binutils in
isolation.
bfd/ChangeLog:
2021-12-31 Tamar Christina <tamar.christina@arm.com>
PR ld/28682
* peXXigen.c: Fix conditional.
coff_get_symbol_info (abfd, symbol, ret);
}
-#if !defined(COFF_WITH_pep) && defined(COFF_WITH_pex64) && defined(COFF_WITH_peAArch64)
+#if !defined(COFF_WITH_pep) && (defined(COFF_WITH_pex64) || defined(COFF_WITH_peAArch64))
static int
sort_x64_pdata (const void *l, const void *r)
{
/* If there is a .pdata section and we have linked pdata finally, we
need to sort the entries ascending. */
-#if !defined(COFF_WITH_pep) && defined(COFF_WITH_pex64) && defined(COFF_WITH_peAArch64)
+#if !defined(COFF_WITH_pep) && (defined(COFF_WITH_pex64) || defined(COFF_WITH_peAArch64))
{
asection *sec = bfd_get_section_by_name (abfd, ".pdata");