On Sun, May 24, 2020 at 4:49 PM Konstantin Belousov <kostik...@gmail.com>
wrote:

> On Sun, May 24, 2020 at 03:45:47PM +0200, Damjan Jovanovic wrote:
> > On Sun, May 24, 2020 at 3:40 PM Gerald Pfeifer <ger...@pfeifer.com>
> wrote:
> >
> > > On Sat, 23 May 2020, Damjan Jovanovic wrote:
> > > > For Wine. I'll submit it upstream when the rtld-elf patch goes into
> > > > stable/12.
> > >
> > > What will happen to users on FreeBSD 11 (or 12 before the rtld-elf
> > > patch) when that additional patch goes into upstream Wine?
> > >
> > > Gerald
> > >
> >
> > This is the patch I would send, it effectively changes 2 lines to check
> an
> > extra condition (__FreeBSD_version < 1202000):
> >
> >
> > commit c81fc2e8dc75c5dcab300da4fa6cc6ccfb0c3d15 (freebsd-mmap)
> > Author: Damjan Jovanovic <damjan....@gmail.com>
> > Date:   Sat May 23 13:49:31 2020 +0200
> >
> >     ntdll: only use the link_map.l_addr workaround on FreeBSD < 12.2
> >
> >     FreeBSD 12.2 will change the meaning of link_map.l_addr to be
> >     the offset from file addresses to RAM addresses, like it is in
> >     Linux/NetBSD/Illumos
> >     (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246561)
> >
> >     Signed-off-by: Damjan Jovanovic <damjan....@gmail.com>
> >
> > diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
> > index 6e41b37ad8..bdd7794683 100644
> > --- a/dlls/ntdll/loader.c
> > +++ b/dlls/ntdll/loader.c
> > @@ -1317,7 +1317,7 @@ static void call_tls_callbacks( HMODULE module,
> UINT
> > reason )
> >      }
> >  }
> >
> > -#ifdef __FreeBSD__
> > +#if defined(__FreeBSD__) && (__FreeBSD_version < 1202000)
> >  /* The PT_LOAD segments are sorted in increasing order, and the first
> >   * starts at the beginning of the ELF file. By parsing the file, we can
> >   * find that first PT_LOAD segment, from which we can find the base
> > @@ -1370,7 +1370,7 @@ static void call_constructors( WINE_MODREF *wm )
> >      {
> >          caddr_t relocbase = (caddr_t)map->l_addr;
> >
> > -#ifdef __FreeBSD__  /* FreeBSD doesn't relocate l_addr */
> > +#if defined(__FreeBSD__) && (__FreeBSD_version < 1202000)  /* FreeBSD
> > doesn't relocate l_addr */
> >          if (!get_relocbase(map->l_addr, &relocbase)) return;
> >  #endif
> >          switch (dyn->d_tag)
> Can you check for presence of link_map.l_base instead of looking for
> the version ?  Configure scripts should easily handle this.
>

There is no link_map.l_base in your commit:
https://svnweb.freebsd.org/base/head/sys/sys/link_elf.h?r1=326256&r2=361303&pathrev=361303
_______________________________________________
freebsd-emulation@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "freebsd-emulation-unsubscr...@freebsd.org"

Reply via email to