From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by sourceware.org (Postfix) with ESMTPS id B1A113AA8024 for ; Fri, 27 May 2022 12:23:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B1A113AA8024 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-f2e0a41009so4140132fac.6 for ; Fri, 27 May 2022 05:23:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=J683ud95YMYKQ+H2daf688RlwX1lgLheSpMRjx1KuqE=; b=G5RzLc64s/wuxrgGBMKWwVkvrnUVJk+O/sl2tRvUQCfF/TA3qNDL4+hTCdM+ldgSix IOt47Aekq5TW1tOaRaTd7W5wN/KT7yZabFiRVYOGPP3rKNFFqAu7ehebCLTRYUZrOdX5 pGgz3vFyxji3teTTR13QBWNLKvqJVax2jIcqxsAzvdFlbonxfxCI6TmzxZSEpj/64w2F o0+VWNg12BnOltwxtPO+Mch2L6Q+5bS0jMgyhcyZQXpqFiT835VMeB8iYFEMtYgyecwO 8XeJoPwnO5LpPX/PdsGfxQ/4hEShlQUXzev8VaE05dePxLxl7K8mbc42YXq5wDtCy4qN d4zw== X-Gm-Message-State: AOAM5302xQp5gRG18Hrlm4rvvUm/ytDbBoQ28EMJjkivyearncBVuPVR o2r+7iIJ6d1oBEzHBxr9ZJC9fA== X-Google-Smtp-Source: ABdhPJxcMHtsQXCZJzPpw7otFgq8qcfksFFMNvLSjLIpwWQYHQEcqu1PHs42He8E/xnfiYQKD1hEAw== X-Received: by 2002:a05:6870:64ab:b0:f1:8a2f:ca8c with SMTP id cz43-20020a05687064ab00b000f18a2fca8cmr3751338oab.139.1653654217031; Fri, 27 May 2022 05:23:37 -0700 (PDT) Received: from ?IPV6:2804:431:c7cb:9f85:b770:666d:a956:2e6a? ([2804:431:c7cb:9f85:b770:666d:a956:2e6a]) by smtp.gmail.com with ESMTPSA id ps8-20020a0568709e0800b000f1bc45ba21sm614021oab.14.2022.05.27.05.23.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 May 2022 05:23:36 -0700 (PDT) Message-ID: Date: Fri, 27 May 2022 09:23:33 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 05/17] hppa: Remove _dl_skip_args usage (BZ# 29165) Content-Language: en-US To: John David Anglin , Florian Weimer , Adhemerval Zanella via Libc-alpha Cc: Szabolcs Nagy , danglin@gcc.gnu.org References: <20220526165003.705355-1-adhemerval.zanella@linaro.org> <20220526165003.705355-6-adhemerval.zanella@linaro.org> <87bkvk9n5x.fsf@oldenburg.str.redhat.com> <7b31d1c3-c781-e0a0-8da9-3fb3aa02bae9@linaro.org> <23dc7181-4f9d-ae45-1e23-c3efbafd7d28@bell.net> <87436ccd-8bb8-2bb1-fbb6-cd5310928aa6@linaro.org> <3523cef1-34a7-56ce-6d7f-9eb3b0cda0b6@bell.net> From: Adhemerval Zanella In-Reply-To: <3523cef1-34a7-56ce-6d7f-9eb3b0cda0b6@bell.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2022 12:23:39 -0000 On 26/05/2022 21:01, John David Anglin wrote: > On 2022-05-26 7:10 p.m., Adhemerval Zanella wrote: >> >> On 26/05/2022 15:58, John David Anglin wrote: >>> On 2022-05-26 2:23 p.m., Adhemerval Zanella wrote: >>>> On 26/05/2022 15:14, Florian Weimer wrote: >>>>> * Adhemerval Zanella via Libc-alpha: >>>>> >>>>>> Different than other architectures, hppa creates an unrelated stack >>>>>> frame where ld.so argc/argv adjustments done by ad43cac44a6860eaefc >>>>>> is not done on the argc/argv saved/restore by _dl_start_user. >>>>>> >>>>>> Instead load _dl_argc and _dl_argv directlty instead of adjust them >>>>>> using _dl_skip_args value. >>>>>> >>>>>> Checked on hppa-linux-gnu. >>>>> Does this fix bug 29165?  If yes, it should say so on the commit >>>>> message. >>>> It does, I assumed the title was suffice. I will add a note in the >>>> commit itself. >>> This comment could be improved: >>> >>>> +      It also mean that to get the correct argc and argv if the    \ >>>> +      program is ld.so it requires to read _dl_argc and _dl_argv. */\ >>> "mean" should be "means" and the wording is somewhat stilted. >>> >> Indeed it sounds strange, I have changed to: >> >>           Also, the loader will adjust argc, argv, env, and aux vectors \ >>           directly on the stack to remove any arguments used for direct \ >>           loader invocation.  So it requires to use _dl_argc and           \ >>      _dl_argv instead of reload them from previous saved area.  */ \ > This comment is improved but I would move it before the instructions to load _dl_argc > and _dl_argc in _dl_start_user. > > It is better to use present tense: > >     The loader adjusts argc, argv, env, and the aux vectors \ >     directly on the stack to remove any arguments used for direct \ >     loader invocation.  Thus, argc and argv must be reloaded from \ >     from _dl_argc and _dl_argv.  */ Ack. > > In looking at the code, I think we can remove the following instructions: > >>         /* Save the relevant arguments (yes, those are the correct      \ >>            registers, the kernel is weird) in their stack slots. */     \ >> "       stw     %r25,-40(%sp)\n" /* argc */                             \ >> "       stw     %r24,-44(%sp)\n" /* argv */                             \ > > The saved values are no longer used as far as I can tell. Indeed, I removed them.