From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: John David Anglin <dave.anglin@bell.net>,
Florian Weimer <fweimer@redhat.com>,
Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Cc: Szabolcs Nagy <Szabolcs.Nagy@arm.com>, danglin@gcc.gnu.org
Subject: Re: [PATCH 05/17] hppa: Remove _dl_skip_args usage (BZ# 29165)
Date: Fri, 27 May 2022 09:23:33 -0300 [thread overview]
Message-ID: <ddefcfc9-d8bb-8c85-5d2c-0b6fdca0e808@linaro.org> (raw)
In-Reply-To: <3523cef1-34a7-56ce-6d7f-9eb3b0cda0b6@bell.net>
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.
next prev parent reply other threads:[~2022-05-27 12:23 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-26 16:49 [PATCH 00/17] Remove _dl_skip_args Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 01/17] alpha: Remove _dl_skip_args usage Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 02/17] arm: " Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 03/17] arc: " Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 04/17] csky: " Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 05/17] hppa: Remove _dl_skip_args usage (BZ# 29165) Adhemerval Zanella
2022-05-26 18:14 ` Florian Weimer
2022-05-26 18:23 ` Adhemerval Zanella
2022-05-26 18:34 ` Florian Weimer
2022-05-26 18:58 ` John David Anglin
2022-05-26 23:10 ` Adhemerval Zanella
2022-05-27 0:01 ` John David Anglin
2022-05-27 12:23 ` Adhemerval Zanella [this message]
2022-05-26 16:49 ` [PATCH 06/17] i686: Remove _dl_skip_args usage Adhemerval Zanella
2022-05-26 20:53 ` H.J. Lu
2022-05-26 16:49 ` [PATCH 07/17] ia64: " Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 08/17] m68k: " Adhemerval Zanella
2022-05-26 17:18 ` Andreas Schwab
2022-05-26 17:23 ` Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 09/17] microblaze: " Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 10/17] mips: " Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 11/17] nios2: Remove _dl_skip_args usage (BZ# 29187) Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 12/17] riscv: Remove _dl_skip_args usage Adhemerval Zanella
2022-05-26 16:49 ` [PATCH 13/17] s390: " Adhemerval Zanella
2022-05-26 16:50 ` [PATCH 14/17] sh: " Adhemerval Zanella
2022-05-26 16:50 ` [PATCH 15/17] sparc: " Adhemerval Zanella
2022-05-26 16:50 ` [PATCH 16/17] x86_64: " Adhemerval Zanella
2022-05-26 20:52 ` H.J. Lu
2022-05-26 16:50 ` [PATCH 17/17] elf: Remove _dl_skip_args Adhemerval Zanella
2022-05-30 13:32 ` [PATCH 00/17] " Carlos O'Donell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ddefcfc9-d8bb-8c85-5d2c-0b6fdca0e808@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=Szabolcs.Nagy@arm.com \
--cc=danglin@gcc.gnu.org \
--cc=dave.anglin@bell.net \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).