From 520d5017366ff334c8a866aa15abb8cce22fb952 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Mon, 23 Nov 2015 22:42:53 +0000
Subject: [PATCH] bfd: Increase _bfd_coff_max_nscns to 65279

.. from 32768. This is the value that llvm uses. There's no
indication in the PECOFF specs that 32768 is the limit.
---
 bfd/coff-alpha.c  | 2 +-
 bfd/coff-mips.c   | 2 +-
 bfd/coff-rs6000.c | 2 +-
 bfd/coff-sh.c     | 2 +-
 bfd/coffcode.h    | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index 15fea1fde34..c5547259956 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -2304,7 +2304,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
     alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out,
     alpha_ecoff_swap_scnhdr_out,
     FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true,
-    ECOFF_NO_LONG_SECTION_NAMES, 4, false, 2, 32768,
+    ECOFF_NO_LONG_SECTION_NAMES, 4, false, 2, 65279,
     alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in,
     alpha_ecoff_swap_scnhdr_in, NULL,
     alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c
index 963ab249119..935bb0c5702 100644
--- a/bfd/coff-mips.c
+++ b/bfd/coff-mips.c
@@ -1314,7 +1314,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
     mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out,
     mips_ecoff_swap_scnhdr_out,
     FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true,
-    ECOFF_NO_LONG_SECTION_NAMES, 4, false, 2, 32768,
+    ECOFF_NO_LONG_SECTION_NAMES, 4, false, 2, 65279,
     mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in,
     mips_ecoff_swap_scnhdr_in, NULL,
     mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index 45ba9b3cb00..744c61bafb9 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -4382,7 +4382,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
       3,			/* _bfd_coff_default_section_alignment_power */
       false,			/* _bfd_coff_force_symnames_in_strings */
       2,			/* _bfd_coff_debug_string_prefix_length */
-      32768,			/* _bfd_coff_max_nscns */
+      65279,			/* _bfd_coff_max_nscns */
       coff_swap_filehdr_in,
       coff_swap_aouthdr_in,
       coff_swap_scnhdr_in,
diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c
index 10d203f5280..ef793612bf7 100644
--- a/bfd/coff-sh.c
+++ b/bfd/coff-sh.c
@@ -3094,7 +3094,7 @@ static bfd_coff_backend_data bfd_coff_small_swap_table =
 #else
   2,
 #endif
-  32768,
+  65279,
   coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in,
   coff_swap_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
   coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index f65f3352e46..25384adfde8 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -5415,7 +5415,7 @@ static bfd_coff_backend_data bfd_coff_std_swap_table ATTRIBUTE_UNUSED =
 #else
   2,
 #endif
-  32768,
+  65279,
   coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
   coff_SWAP_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
   coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
-- 
2.32.0
