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 62ACF3858437 for ; Mon, 6 Dec 2021 18:51:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 62ACF3858437 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 1B6Ip1CZ022791 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 6 Dec 2021 13:51:06 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1B6Ip1CZ022791 Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 556D71EDEE; Mon, 6 Dec 2021 13:50:58 -0500 (EST) Subject: Re: [PATCH ver3] gdb: Add PowerPC support to gdb.dwarf2/frame-inlined-in-outer-frame.exp To: Carl Love , gdb-patches@sourceware.org, Ulrich Weigand Cc: Rogerio Alves , Will Schmidt References: <61a8f3c2be6a60ff211ca02469bf3ce4554a36b1.camel@us.ibm.com> <92b6daba-54d6-bb1f-4c99-10b3ec32d3ec@polymtl.ca> <73426fba8d9ce1eb5fc60ae64a2ecd57074c510a.camel@us.ibm.com> From: Simon Marchi Message-ID: <6f99e11d-25a7-ceaa-0975-06ac1d9d5d05@polymtl.ca> Date: Mon, 6 Dec 2021 13:50:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 6 Dec 2021 18:51:01 +0000 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 Dec 2021 18:51:10 -0000 On 2021-12-06 1:06 p.m., Carl Love wrote: > Simon: > > On Mon, 2021-12-06 at 11:43 -0500, Simon Marchi wrote: >>> +#if defined __powerpc64__ >>> +# if _CALL_ELF == 2 >>> +.abiversion 2 /* Tell gdb what ELF version to use. */ >>> +.global _start >>> +_start: >>> +# else >>> +.abiversion 1 /* Tell gdb what ELF version to use. */ >>> +.align 2 >>> +.global _start >>> +.section ".opd", "aw" >>> +.align 3 >>> +_start: >>> +.quad ._start,.TOC.@tocbase,0 >>> +.previous >>> +.type ._start,@function >>> +._start: >>> +# endif >>> +#else >>> .global _start >>> _start: >>> +#endif >> >> My only question is whether these two lines: >> >> .global _start >> _start: >> >> could be kept unconditional, and just not put in the powerpc-specific >> sections of the code at all. > > I chose to have them in the Power #if case with the .abiversion 2 > statement and in the #else for all other architectures. On Power, we > must include .abiversion 2. I just don't know if on other platforms > .abiversion 2 is a valid statement or not? So, I chose not to include > it, i.e. don't change anything for other architectures to be sure I > don't break them. Basically, I took the most conservative approach as > I can't test all the other architectures. > > Carl I wasn't clear. I was wondering if this would work (not duplicate `.global _start ` and `._start:`: #if defined __powerpc64__ # if _CALL_ELF == 2 .abiversion 2 /* Tell gdb what ELF version to use. */ # else .abiversion 1 /* Tell gdb what ELF version to use. */ .align 2 .section ".opd", "aw" .align 3 .quad ._start,.TOC.@tocbase,0 .previous .type ._start,@function # endif #endif .global _start _start: Simon