[binutils-gdb] bfd: add missing smclass when creating csect for xcoff64

Alan Modra amodra@sourceware.org
Fri Mar 12 12:18:02 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8aa2d0236a5cf981aff44cf679515c6031a152bd

commit 8aa2d0236a5cf981aff44cf679515c6031a152bd
Author: Clément Chigot <clement.chigot@atos.net>
Date:   Thu Mar 11 11:08:18 2021 +0100

    bfd: add missing smclass when creating csect for xcoff64
    
            * coff64-rs6000.c (xcoff64_create_csect_from_smclas): Add
            missing smclass.

Diff:
---
 bfd/ChangeLog       | 5 +++++
 bfd/coff64-rs6000.c | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c184a4e72fc..bf28d8a2414 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2021-03-12  Clément Chigot  <clement.chigot@atos.net>
+
+	* coff64-rs6000.c (xcoff64_create_csect_from_smclas): Add
+	missing smclass.
+
 2021-03-11  Nelson Chu  <nelson.chu@sifive.com>
 
 	* elfnn-riscv.c (riscv_elf_link_hash_table): New boolean
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index 98b0066822a..21287c73c1b 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -2127,14 +2127,14 @@ xcoff64_create_csect_from_smclas (bfd *abfd, union internal_auxent *aux,
   /* Changes from 32 :
      .sv == 8, is only for 32 bit programs
      .ti == 12 and .tb == 13 are now reserved.  */
-  static const char *names[19] =
+  static const char * const names[] =
   {
     ".pr", ".ro", ".db", ".tc", ".ua", ".rw", ".gl", ".xo",
     NULL, ".bs", ".ds", ".uc", NULL,  NULL,  NULL,  ".tc0",
-    ".td", ".sv64", ".sv3264"
+    ".td", ".sv64", ".sv3264", NULL, ".tl", ".ul", ".te"
   };
 
-  if ((19 >= aux->x_csect.x_smclas)
+  if ((aux->x_csect.x_smclas < ARRAY_SIZE (names))
       && (NULL != names[aux->x_csect.x_smclas]))
     {


More information about the Binutils-cvs mailing list