From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by sourceware.org (Postfix) with ESMTPS id AC1573858D37 for ; Mon, 6 Jul 2020 20:12:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AC1573858D37 Received: by mail-qt1-x844.google.com with SMTP id w34so9975551qte.1 for ; Mon, 06 Jul 2020 13:12:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ThiD83wVazBJ/32bwlBsD+2w/N+viMBmU95NQz55JZ8=; b=rsCAuOh4K48+7guxJDdfswBynm1Mo86/wJlsyMUXzvZmBS2mU/rXSFWDZsG2T7AF9a 5NGOr3A5D1Zh6p+mcEpPl+9orQbmq16DLKx59ZBBcFKWFLLzjdIealNTnXBtJQROFjl8 eB6Kz9+Vc8s28VRBSplhyUeX6MupG5KHCDP7AF+1EQmLUyGvxBSzwdOf5AjcWlbHPjVL iq8LACd/Mj7gYPAv+uUP57GX3C76KZIcoUnciIs3f2Y4zSMqt7Je2oIqepzcIvVc43kD IzYB8NuKp8Jj1fXENFbusWWXvMrYAWei5g+M0B4GB53VL0wfow1ov9FAOuvANyxX8GnV Ykmg== X-Gm-Message-State: AOAM533KpcWVjkd4ykuxkxVlCyrowcIQm8wHlveMLEAnkFPM7XXGuuC/ dmaKkslI6AMX0tY4vH+dArdGCpXop18qPj9o7HFc50az X-Google-Smtp-Source: ABdhPJyvtkOZ08S35bPrXZ80VDHbNxJzcnc6e2mDurN1W/5ojlSSNOW2wBJuXMvoypM7bqylQBctYjMekGjd6zTHJL0= X-Received: by 2002:ac8:748a:: with SMTP id v10mr47446378qtq.19.1594066372988; Mon, 06 Jul 2020 13:12:52 -0700 (PDT) MIME-Version: 1.0 References: <20200701213225.14144-1-jon.turney@dronecode.org.uk> <20200701213225.14144-4-jon.turney@dronecode.org.uk> In-Reply-To: <20200701213225.14144-4-jon.turney@dronecode.org.uk> From: Christian Biesinger Date: Mon, 6 Jul 2020 15:12:16 -0500 Message-ID: Subject: Re: [PATCH 3/7] Don't hardcode CONTEXT size for a NOTE_INFO_THREAD win32pstatus note To: Jon Turney Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-22.4 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2020 20:12:54 -0000 On Wed, Jul 1, 2020 at 4:33 PM Jon Turney wrote: > > Don't hardcode the size of the Win32 API thread CONTEXT type read from a > NOTE_INFO_THREAD win32pstatus note (since it's different on different > architectures). > > bfd/ChangeLog: > > 2020-07-01 Jon Turney > > * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of > the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD > win32pstatus note. > --- > bfd/ChangeLog | 6 ++++++ > bfd/elf.c | 2 +- > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/bfd/elf.c b/bfd/elf.c > index a7790a4eec4..a61e2b7dd1d 100644 > --- a/bfd/elf.c > +++ b/bfd/elf.c > @@ -10171,7 +10171,7 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) > return FALSE; > > /* sizeof (thread_info.thread_context) */ > - sect->size = 716; > + sect->size = note->descsz - 12; I guess the "sizeof" comment is now wrong -- where does the "12" come from though? > /* offsetof (thread_info.thread_context) */ > sect->filepos = note->descpos + 12; > sect->alignment_power = 2; > -- > 2.27.0 >