From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6558 invoked by alias); 26 Oct 2016 21:07:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 6545 invoked by uid 89); 26 Oct 2016 21:07:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Subject: Re: [PATCH] Initialise the machine specific part of rtld bootstrap map To: Matthew Fortune , Joseph Myers References: <6D39441BF12EF246A7ABCE6654B0235380AABFF9@HHMAIL01.hh.imgtec.org> <6D39441BF12EF246A7ABCE6654B0235380AAC147@HHMAIL01.hh.imgtec.org> CC: "libc-alpha@sourceware.org" , Petar Jovanovic From: Sandra Loosemore Message-ID: <58111B09.1070906@codesourcery.com> Date: Wed, 26 Oct 2016 21:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <6D39441BF12EF246A7ABCE6654B0235380AAC147@HHMAIL01.hh.imgtec.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-04.mgc.mentorg.com (147.34.90.204) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-SW-Source: 2016-10/txt/msg00480.txt.bz2 On 10/26/2016 03:01 PM, Matthew Fortune wrote: > Joseph Myers writes: >> On Wed, 26 Oct 2016, Matthew Fortune wrote: >> >>> +# ifdef ELF_MACHINE_INIT_MAP >>> + ELF_MACHINE_INIT_MAP (bootstrap_map); # endif >> >> We don't encourage use of #ifdef like that. It's better to have an >> inline function defined everywhere and used unconditionally, for which >> most systems have a dummy definition (see dl-machine-reject-phdr.h and >> elf_machine_reject_phdr_p for an example - if you have a header for a >> single function, you don't need to update lots of dl-machine.h headers, >> just add a generic version - which has the comments detailing the >> semantics of the function and when it's needed - and a MIPS version). > > Thanks Joseph. It's been a while since I did a glibc patch and couldn't > remember the recommended approach. > > Do you think I should add a whole new header for this? Or, since this > is directly related to the reject_phdr feature for MIPS and only MIPS > is affected then I could just add it to dl-machine-reject-phdr.h? Wouldn't it be easier and more maintainable just to unconditionally zero-initialize the structure, as I did in the original patch? -Sandra