From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 1BE033858D37; Sun, 12 Jul 2020 14:10:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BE033858D37 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jon TURNEY To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: Update ELF target used by dumper on x86_64 X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: f2a285bd4f424f0c84017b6051dcdd8acf221de8 X-Git-Newrev: 38f88601469f4a6ab7cf42e1f076775c99eb17f2 Message-Id: <20200712141034.1BE033858D37@sourceware.org> Date: Sun, 12 Jul 2020 14:10:34 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jul 2020 14:10:34 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=38f88601469f4a6ab7cf42e1f076775c99eb17f2 commit 38f88601469f4a6ab7cf42e1f076775c99eb17f2 Author: Jon Turney Date: Mon Jun 29 14:36:00 2020 +0100 Cygwin: Update ELF target used by dumper on x86_64 Like [1], but actually making the effort to be 'usable' and 'tested'. [1] https://cygwin.com/pipermail/cygwin/2019-October/242815.html Diff: --- winsup/utils/dumper.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc index 226c2283d..e16d80a36 100644 --- a/winsup/utils/dumper.cc +++ b/winsup/utils/dumper.cc @@ -645,7 +645,13 @@ dumper::init_core_dump () { bfd_init (); - core_bfd = bfd_openw (file_name, "elf32-i386"); +#ifdef __x86_64__ + const char *target = "elf64-x86-64"; +#else + const char *target = "elf32-i386"; +#endif + + core_bfd = bfd_openw (file_name, target); if (core_bfd == NULL) { bfd_perror ("opening bfd"); @@ -658,7 +664,7 @@ dumper::init_core_dump () goto failed; } - if (!bfd_set_arch_mach (core_bfd, bfd_arch_i386, 0)) + if (!bfd_set_arch_mach (core_bfd, bfd_arch_i386, 0 /* = default */)) { bfd_perror ("setting bfd architecture"); goto failed;