From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 55320386F41D; Fri, 22 Jan 2021 22:17:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 55320386F41D Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 10MMHY4m001800 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Jan 2021 17:17:39 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 10MMHY4m001800 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 7D4961E940; Fri, 22 Jan 2021 17:17:34 -0500 (EST) Subject: Re: [PATCH 1/5] bfd: add elfcore_write_file_note To: Mihails Strasuns , gdb-patches@sourceware.org References: <20210103130300.21637-1-mihails.strasuns@intel.com> <20210103130300.21637-2-mihails.strasuns@intel.com> Cc: binutils@sourceware.org From: Simon Marchi Message-ID: <618186a8-b1c4-43b8-ff06-46c1d520d5d0@polymtl.ca> Date: Fri, 22 Jan 2021 17:17:34 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210103130300.21637-2-mihails.strasuns@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 22 Jan 2021 22:17:34 +0000 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2021 22:17:43 -0000 Adding binutils@ in CC, can someone over there please review this change? The full series is here: https://sourceware.org/pipermail/gdb-patches/2021-January/174652.html Simon On 2021-01-03 8:02 a.m., Mihails Strasuns via Gdb-patches wrote: > Adds a trivial wrapper over elfcore_write_note, primarily to be more > consistent with other ELF note helper functions and highlight NT_FILE as > one of notes handled by gdb. > > bfd/ChangeLog: > 2020-12-17 Mihails Strasuns > > * bfd-elf.h (elfcore_write_file_note): New function. > * elf.c (elfcore_write_file_note): New function. > > gdb/ChangeLog: > 2020-12-17 Mihails Strasuns > > * linux-tdep.c (linux_make_mappings_corefile_notes): Start using > elfcore_write_file_note. > --- > bfd/elf-bfd.h | 2 ++ > bfd/elf.c | 8 ++++++++ > gdb/linux-tdep.c | 8 +++----- > 3 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h > index 53b5ffc33d..75d5576042 100644 > --- a/bfd/elf-bfd.h > +++ b/bfd/elf-bfd.h > @@ -2801,6 +2801,8 @@ extern char *elfcore_write_lwpstatus > (bfd *, char *, int *, long, int, const void *); > extern char *elfcore_write_register_note > (bfd *, char *, int *, const char *, const void *, int); > +extern char *elfcore_write_file_note > + (bfd *, char *, int *, const void*, int); > > /* Internal structure which holds information to be included in the > PRPSINFO section of Linux core files. > diff --git a/bfd/elf.c b/bfd/elf.c > index 9c82912aeb..070db5b180 100644 > --- a/bfd/elf.c > +++ b/bfd/elf.c > @@ -12028,6 +12028,14 @@ elfcore_write_register_note (bfd *abfd, > return NULL; > } > > +char * > +elfcore_write_file_note (bfd *obfd, char *note_data, int *note_size, > + const void *buf, int bufsiz) > +{ > + return elfcore_write_note (obfd, note_data, note_size, > + "CORE", NT_FILE, buf, bufsiz); > +} > + > static bfd_boolean > elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset, > size_t align) > diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c > index 5ae28d826c..5b44e7135b 100644 > --- a/gdb/linux-tdep.c > +++ b/gdb/linux-tdep.c > @@ -1591,11 +1591,9 @@ linux_make_mappings_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, > obstack_grow (&data_obstack, obstack_base (&filename_obstack), > size); > > - note_data.reset (elfcore_write_note > - (obfd, note_data.release (), > - note_size, "CORE", NT_FILE, > - obstack_base (&data_obstack), > - obstack_object_size (&data_obstack))); > + note_data.reset (elfcore_write_file_note (obfd, note_data.release (), note_size, > + obstack_base (&data_obstack), > + obstack_object_size (&data_obstack))); > } > } > >