public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [committed][PATCH][Binutils][pe] ld: fix coff PE SEH
@ 2021-12-31 11:40 Tamar Christina
  0 siblings, 0 replies; only message in thread
From: Tamar Christina @ 2021-12-31 11:40 UTC (permalink / raw)
  To: binutils; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 1705 bytes --]

Hi All,

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.

Manually tested example in PR and works now.

Cross-compiled and regtested on x86_64-w64-mingw32 and no issues.

Committed as a trivial change.

Thanks,
Tamar

bfd/ChangeLog:

2021-12-31  Tamar Christina  <tamar.christina@arm.com>

	PR ld/28682
	* peXXigen.c: Fix conditional.

--- inline copy of patch -- 
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 5f977ea32dce48843604e8d789ac1de72e380679..48e52b0904609fe3ff80b76a8f3b8ca7df1c780b 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -3088,7 +3088,7 @@ _bfd_XX_get_symbol_info (bfd * abfd, asymbol *symbol, symbol_info *ret)
   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)
 {
@@ -4516,7 +4516,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
 
 /* 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");
 


-- 

[-- Attachment #2: rb15182.patch --]
[-- Type: text/x-diff, Size: 1041 bytes --]

diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 5f977ea32dce48843604e8d789ac1de72e380679..48e52b0904609fe3ff80b76a8f3b8ca7df1c780b 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -3088,7 +3088,7 @@ _bfd_XX_get_symbol_info (bfd * abfd, asymbol *symbol, symbol_info *ret)
   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)
 {
@@ -4516,7 +4516,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
 
 /* 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");
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-31 11:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-31 11:40 [committed][PATCH][Binutils][pe] ld: fix coff PE SEH Tamar Christina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).