From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 114E63858D37; Sun, 19 Mar 2023 22:45:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 114E63858D37 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] Enable vector register visibility in core file for AIX binutils X-Act-Checkin: binutils-gdb X-Git-Author: Aditya Vidyadhar Kamath X-Git-Refname: refs/heads/master X-Git-Oldrev: 2bdec58f594eb02cbd18517c56de74282f20dd4b X-Git-Newrev: 1a2c0dc1ab7aff2d1bca30a93dc4edb255828d15 Message-Id: <20230319224558.114E63858D37@sourceware.org> Date: Sun, 19 Mar 2023 22:45:58 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Mar 2023 22:45:58 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D1a2c0dc1ab7a= ff2d1bca30a93dc4edb255828d15 commit 1a2c0dc1ab7aff2d1bca30a93dc4edb255828d15 Author: Aditya Vidyadhar Kamath Date: Mon Mar 13 07:32:57 2023 -0500 Enable vector register visibility in core file for AIX binutils =20 This patch will enable vector register visibility when AIX FOLKS do core file analysis. Diff: --- bfd/aix5ppc-core.c | 21 +++++++++++++++++++++ bfd/rs6000-core.c | 16 +++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/bfd/aix5ppc-core.c b/bfd/aix5ppc-core.c index 0a338ac391b..fae8bb6cb1a 100644 --- a/bfd/aix5ppc-core.c +++ b/bfd/aix5ppc-core.c @@ -142,6 +142,27 @@ xcoff64_core_p (bfd *abfd) sec->filepos =3D 0; sec->contents =3D (bfd_byte *)&new_core_hdr->c_flt.r64; =20 + if (core.c_extctx) + { + /* vmx section. */ + flags =3D SEC_HAS_CONTENTS; + sec =3D bfd_make_section_anyway_with_flags (abfd, ".aix-vmx", flags); + if (sec =3D=3D NULL) + return NULL; + sec->size =3D 560; + sec->vma =3D 0; + sec->filepos =3D core.c_extctx; + + /* vmx section. */ + flags =3D SEC_HAS_CONTENTS; + sec =3D bfd_make_section_anyway_with_flags (abfd, ".aix-vsx", flags); + if (sec =3D=3D NULL) + return NULL; + sec->size =3D 256; + sec->vma =3D 0; + sec->filepos =3D core.c_extctx + 584; + } + /* .ldinfo section. To actually find out how long this section is in this particular core dump would require going down the whole list of struct diff --git a/bfd/rs6000-core.c b/bfd/rs6000-core.c index eb096098256..e8efeef5951 100644 --- a/bfd/rs6000-core.c +++ b/bfd/rs6000-core.c @@ -342,7 +342,7 @@ rs6000coff_core_p (bfd *abfd) /* Values from new and old core structures. */ int c_flag; file_ptr c_stack, c_regoff, c_loader; - bfd_size_type c_size, c_regsize, c_lsize; + bfd_size_type c_size, c_regsize, c_lsize, c_extoff; bfd_vma c_stackend; void *c_regptr; int proc64; @@ -370,6 +370,7 @@ rs6000coff_core_p (bfd *abfd) c_stackend =3D CNEW_STACKORG (core.new_dump) + c_size; c_lsize =3D CNEW_LSIZE (core.new_dump); c_loader =3D CNEW_LOADER (core.new_dump); + c_extoff =3D core.new_dump.c_extctx; #ifndef BFD64 proc64 =3D CNEW_PROC64 (core.new_dump); } @@ -517,6 +518,19 @@ rs6000coff_core_p (bfd *abfd) c_regsize, (bfd_vma) 0, c_regoff)) goto fail; =20 + if (c_extoff) + { + if (!make_bfd_asection (abfd, ".aix-vmx", + SEC_HAS_CONTENTS, + 560, (bfd_vma) 0, c_extoff)) + goto fail; + + if (!make_bfd_asection (abfd, ".aix-vsx", + SEC_HAS_CONTENTS, + 256, (bfd_vma) 0, c_extoff + 584)) + goto fail; + } + /* .ldinfo section. To actually find out how long this section is in this particular core dump would require going down the whole list of struct ld_info's.