commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hurd,commited] hurd: Fix static-PIE startup


From: H.J. Lu
Subject: Re: [hurd,commited] hurd: Fix static-PIE startup
Date: Tue, 1 Feb 2022 06:19:26 -0800

On Mon, Jan 31, 2022 at 4:58 PM Samuel Thibault <samuel.thibault@gnu.org> wrote:
>
> H.J. Lu via Libc-alpha, le lun. 31 janv. 2022 16:53:19 -0800, a ecrit:
> > On Mon, Jan 31, 2022 at 4:49 PM Samuel Thibault <samuel.thibault@gnu.org> 
> > wrote:
> > > H.J. Lu, le lun. 31 janv. 2022 16:14:59 -0800, a ecrit:
> > > > > +#define SET_RELHOOK(NAME, HOOK) \
> > > > > +       asm(".section " #NAME",\"aR\"\n" \
> > > > > +           ".quad "#HOOK" - .\n" \
> > > > > +           ".section .text");
> > > > > +
> > > > > +#endif /* set_hooks_arch.h */
> > > >
> > > > SET_RELHOOK is used only for hurd which doesn't support x86-64.
> > >
> > > We plan to support x86-64 relatively soon.
> > >
> >
> > Then please put it under the x86-64 directory for hurd.   It doesn't
> > belong to sysdeps/x86_64.
>
> Why not?  The problem is the same for all x86-64 ports, it's not
> specific to the Hurd port.  It happens that DEFINE_HOOK is not widely
> used in the glibc, and notably not for initialization steps that are
> before the csu relocation.  But that's still something that could happen
> someday.  Why hiding this solution behind a hurd/ directory?

1. We don't need separate files for i386 and x86-64.

#define SET_RELHOOK(NAME, HOOK) \
asm(".section " #NAME",\"aR\"\n" \
    ".dc.a "#HOOK" - .\n" \
    ".section .text");

works for both.

2. If Linux needs it, it can be put in sysdeps/generic/set-hooks-arch.h

Please create sysdeps/mach/hurd/x86/set-hooks-arch.h with
SET_RELHOOK.

-- 
H.J.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]