Message ID | 1424653681-18053-1-git-send-email-takahiro.akashi@linaro.org |
---|---|
State | New, archived |
Headers |
Received: (qmail 4087 invoked by alias); 23 Feb 2015 01:08:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 4070 invoked by uid 89); 23 Feb 2015 01:08:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f52.google.com Received: from mail-pa0-f52.google.com (HELO mail-pa0-f52.google.com) (209.85.220.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 23 Feb 2015 01:08:51 +0000 Received: by pabrd3 with SMTP id rd3so23369435pab.4 for <gdb-patches@sourceware.org>; Sun, 22 Feb 2015 17:08:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2ApvpEAsQasj4/R+jSGPU/BgGXs1rQDggwUTrugKSSU=; b=i1tLXnKsd3/AyUtpx01LjTvpNS2guX4nQHJw2rQO9XOXeKDs9ZXf/KOEXlRdEzm2OG vTGGXLbGJgRRvRKSxPHYbsNlWP0lncioPuAqNsGGxxUthVOmC/qpMMG4YZKKU/l86Ysi bJk3/2l86mZRn4mAUwOJ1nMwu5emmmaUikzc7nfLSHlRECpK61dA+98r9sNYydJ2MIHH ljk1wTgQbxDAreluqPzDBCIrIrrIVOs9fZQJ6PRoqgb2r2oEkT3Y1cOchpvVVgsm1P8K f1lgt1t54PQydoylxonZ3laVA1HTzpBejL7hN+URSCudoGmy+qtcm031N8zzw3/YAXmp eW9A== X-Gm-Message-State: ALoCoQnCXJyX6dYwDz8ppxLz72CYSAg764OeOqWsQURL5YU4cn60I3VYGCbAcw6Cq5IG/Iud+dP8 X-Received: by 10.68.178.100 with SMTP id cx4mr15019201pbc.158.1424653729505; Sun, 22 Feb 2015 17:08:49 -0800 (PST) Received: from localhost.localdomain (61-205-4-107m5.grp1.mineo.jp. [61.205.4.107]) by mx.google.com with ESMTPSA id dy3sm34029750pab.33.2015.02.22.17.08.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Feb 2015 17:08:48 -0800 (PST) From: AKASHI Takahiro <takahiro.akashi@linaro.org> To: gdb-patches@sourceware.org Cc: will.deacon@arm.com, dsaxena@linaro.org, yufeng.zhang@arm.com, AKASHI Takahiro <takahiro.akashi@linaro.org> Subject: [PATCH] aarch64: correct a size of struct elf_prstatus Date: Mon, 23 Feb 2015 10:08:01 +0900 Message-Id: <1424653681-18053-1-git-send-email-takahiro.akashi@linaro.org> |
Commit Message
AKASHI Takahiro
Feb. 23, 2015, 1:08 a.m. UTC
When gdb reads a vmcore file that kdump generated, it fails, saying
warning: Couldn't find general-purpose registers in core file.
This is because elf64_aarch64_grok_prstatus() fails to read a note section
in a vmcore file due to a wrong size of struct elf_prstatus. The following
commit on kernel changed ELF_NGREG in elf_gregset_t.
commit 9cf2b72b25f3f6a5a1a46a4f36037e66de52465c
Author: Will Deacon <will.deacon@arm.com>
Date: Tue Jan 22 15:34:40 2013 +0000
arm64: elf: fix core dumping to match what glibc expects
This patch fixes an immediate value in elf64_aarch64_grok_prstatus().
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
bfd/elf64-aarch64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 23 February 2015 at 01:08, AKASHI Takahiro <takahiro.akashi@linaro.org> wrote: > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> > --- > bfd/elf64-aarch64.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Hi, I'm confused about which tree / branch this patch is intended for. The file elf64-aarch64.c was replaced with elfxx-aarch64.c and elfnn-aarch64.c back in 2013 with this commit: 2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com> * Makefile.am (BFD64_BACKENDS): Add elfxx-aarch64.c. > diff --git a/bfd/elf64-aarch64.c b/bfd/elf64-aarch64.c > index 94d90c5..0454a18 100644 > --- a/bfd/elf64-aarch64.c > +++ b/bfd/elf64-aarch64.c > @@ -1529,7 +1529,7 @@ elf64_aarch64_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) > default: > return FALSE; > > - case 408: /* sizeof(struct elf_prstatus) on Linux/arm64. */ > + case 392: /* sizeof(struct elf_prstatus) on Linux/arm64. */ > /* pr_cursig */ > elf_tdata (abfd)->core->signal > = bfd_get_16 (abfd, note->descdata + 12); The identical patch was applied to the tree in late 2013 by Matt Leach: +2013-11-12 Matthew Leach <Matthew.Leach@arm.comm> + + * elfxx-aarch64.c (_bfd_aarch64_elf_grok_prstatus): Fix hard-coded + size of struct elf_prstatus. + - case 408: /* sizeof(struct elf_prstatus) on Linux/arm64. */ + case 392: /* sizeof(struct elf_prstatus) on Linux/arm64. */ Cheers /Marcus
Hi On 02/23/2015 05:52 PM, Marcus Shawcroft wrote: > On 23 February 2015 at 01:08, AKASHI Takahiro > <takahiro.akashi@linaro.org> wrote: > >> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> >> --- >> bfd/elf64-aarch64.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > Hi, I'm confused about which tree / branch this patch is intended for. > The file elf64-aarch64.c was replaced with elfxx-aarch64.c and > elfnn-aarch64.c back in 2013 with this commit: > > 2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com> > * Makefile.am (BFD64_BACKENDS): Add elfxx-aarch64.c. I didn't know this. I checked only v7.6, which is a base version of linaro's gdb, and found a wrong value there, so ... I will contact our toolchain team. Thanks, -Takahiro AKASHI >> diff --git a/bfd/elf64-aarch64.c b/bfd/elf64-aarch64.c >> index 94d90c5..0454a18 100644 >> --- a/bfd/elf64-aarch64.c >> +++ b/bfd/elf64-aarch64.c >> @@ -1529,7 +1529,7 @@ elf64_aarch64_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) >> default: >> return FALSE; >> >> - case 408: /* sizeof(struct elf_prstatus) on Linux/arm64. */ >> + case 392: /* sizeof(struct elf_prstatus) on Linux/arm64. */ >> /* pr_cursig */ >> elf_tdata (abfd)->core->signal >> = bfd_get_16 (abfd, note->descdata + 12); > > The identical patch was applied to the tree in late 2013 by Matt Leach: > > +2013-11-12 Matthew Leach <Matthew.Leach@arm.comm> > + > + * elfxx-aarch64.c (_bfd_aarch64_elf_grok_prstatus): Fix hard-coded > + size of struct elf_prstatus. > + > - case 408: /* sizeof(struct elf_prstatus) on > Linux/arm64. */ > + case 392: /* sizeof(struct elf_prstatus) on > Linux/arm64. */ > > Cheers > /Marcus >
diff --git a/bfd/elf64-aarch64.c b/bfd/elf64-aarch64.c index 94d90c5..0454a18 100644 --- a/bfd/elf64-aarch64.c +++ b/bfd/elf64-aarch64.c @@ -1529,7 +1529,7 @@ elf64_aarch64_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) default: return FALSE; - case 408: /* sizeof(struct elf_prstatus) on Linux/arm64. */ + case 392: /* sizeof(struct elf_prstatus) on Linux/arm64. */ /* pr_cursig */ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);