public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/29165] [Regression] broken argv adjustment
Date: Wed, 25 May 2022 13:27:25 +0000	[thread overview]
Message-ID: <bug-29165-131-oKqYPTfBoD@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29165-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29165

--- Comment #7 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
My understanding is hppa has to create the synthetic frame layout and save the
kernel passed argc/argv so the loader can proper obtain them on
_dl_sysdep_parse_arguments.  The call frame is:

  _start 
  \_ _dl_start (void *arg)
     \_ _dl_start_final (void *arg)
         \_ _dl_sysdep_start (void *arg, ...)
             \_ _dl_sysdep_parse_arguments (void **start_argptr, ...)

Once the loader setup _dl_argc and _dl_argc for the application, it does not
matter the kernel passed argc/argv (there are already processed and should not
be visible by the application).

(In reply to dave.anglin from comment #6)
> It looks to me as if _dl_start doesn't call the user entrypoint directly. 
> It calls _start in start.S. _start
> calls __libc_start_main with the argument setup shown in the comment in
> sysdeps/hppa/start.S.
> 
> On 2022-05-25 8:41 a.m., adhemerval.zanella at linaro dot org wrote:
> > https://sourceware.org/bugzilla/show_bug.cgi?id=29165
> >
> > --- Comment #5 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
> > But the start above will tail call _dl_start and _dl_start will call the user
> > entrypoint that will eventually calls exit syscall.  So I can't see why matter
> > restore r24 and r25 at this point, specially since they will point to the ld.so
> > ones.
> >
> > (In reply to dave.anglin from comment #4)
> >> But the comment says these are for (_start) in start.S.
> >>
> >> On 2022-05-25 7:57 a.m., adhemerval.zanella at linaro dot org wrote:
> >>> I don't think it is required since _dl_fini does not have any arguments.
> >>>
> >>> (In reply to dave.anglin from comment #2)
> >>>> Thanks.  I think we need to keep the instructions that save and restore r24
> >>>> and r25.
> >>>> They will be clobbered by call to _dl_init.
> >>>>
> >>>> Will test.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-05-25 13:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21 16:00 [Bug libc/29165] New: " danglin at gcc dot gnu.org
2022-05-24 20:26 ` [Bug libc/29165] " adhemerval.zanella at linaro dot org
2022-05-24 21:01 ` dave.anglin at bell dot net
2022-05-25 11:57 ` adhemerval.zanella at linaro dot org
2022-05-25 12:27 ` dave.anglin at bell dot net
2022-05-25 12:41 ` adhemerval.zanella at linaro dot org
2022-05-25 13:02 ` dave.anglin at bell dot net
2022-05-25 13:27 ` adhemerval.zanella at linaro dot org [this message]
2022-05-25 13:59 ` adhemerval.zanella at linaro dot org
2022-05-30 20:50 ` adhemerval.zanella at linaro dot org
2022-06-10  2:52 ` sam at gentoo dot org

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=bug-29165-131-oKqYPTfBoD@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@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).