Re: [RFC PATCH 7/9] hurd: Generalize init-first.c to support x86_64

2023-02-20 Thread Noah Goldstein
On Sat, Feb 18, 2023 at 2:40 PM Sergey Bugaev via Libc-alpha wrote: > > Signed-off-by: Sergey Bugaev > --- > sysdeps/mach/hurd/{i386 => x86}/init-first.c | 17 ++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > rename sysdeps/mach/hurd/{i386 => x86}/init-first.c (96%) > > di

Re: [RFC PATCH 7/9] hurd: Generalize init-first.c to support x86_64

2023-02-20 Thread Samuel Thibault
Sergey Bugaev, le lun. 20 févr. 2023 20:10:29 +0300, a ecrit: > - the implementation does not seem to actually switch stacks (in fact, > I have removed the unused switch_stacks function in the last commit) > -- so the "gets called with the stack just as the application's entry > point will see it"

Re: [RFC PATCH 7/9] hurd: Generalize init-first.c to support x86_64

2023-02-20 Thread Sergey Bugaev
> I wish I had a better understanding of just what's going on in this > file. Maybe a lot of the hacks can be rewritten in a nicer way. For > instance, do we really need to hijack the return addresses and jump to > init1 in this weird way, only to enable it to access argc/arg0? Since > we know wher

Re: [RFC PATCH 7/9] hurd: Generalize init-first.c to support x86_64

2023-02-20 Thread Sergey Bugaev
On Mon, Feb 20, 2023 at 3:01 AM Samuel Thibault wrote: > That won't work on x86_64: there, arguments are passed mostly through > registers, so &argc won't actually give you the address of arguments on > the stack. Right, good point. I wish I had a better understanding of just what's going on in

Re: [RFC PATCH 7/9] hurd: Generalize init-first.c to support x86_64

2023-02-19 Thread Samuel Thibault
Sergey Bugaev, le sam. 18 févr. 2023 23:37:15 +0300, a ecrit: > Signed-off-by: Sergey Bugaev > --- > sysdeps/mach/hurd/{i386 => x86}/init-first.c | 17 ++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > rename sysdeps/mach/hurd/{i386 => x86}/init-first.c (96%) > > diff --git

[RFC PATCH 7/9] hurd: Generalize init-first.c to support x86_64

2023-02-18 Thread Sergey Bugaev
Signed-off-by: Sergey Bugaev --- sysdeps/mach/hurd/{i386 => x86}/init-first.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) rename sysdeps/mach/hurd/{i386 => x86}/init-first.c (96%) diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/x86/init-first.c