Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2020 15:45:47 +0200
From:      Damjan Jovanovic <damjan.jov@gmail.com>
To:        Gerald Pfeifer <gerald@pfeifer.com>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, freebsd-emulation@freebsd.org
Subject:   Re: Wine 5.9 bugfix
Message-ID:  <CAJm2B-kXrGB88k-oFxH2Le2N---fEL_AUHXQdxgoh-hfM9Jz4Q@mail.gmail.com>
In-Reply-To: <alpine.LSU.2.21.2005232118280.4832@anthias.pfeifer.com>
References:  <CAJm2B-m1JU%2B6J88=7r19cP9y=UXV%2BYmMQwoJgA_Ce1-bWPjiKA@mail.gmail.com> <20200523111633.GO64045@kib.kiev.ua> <CAJm2B-=KYW0aiiEfeE87dv9-cbACY0L_Bj%2BSjp-33kJvuF81Qw@mail.gmail.com> <alpine.LSU.2.21.2005232033330.4832@anthias.pfeifer.com> <CAJm2B-=ovDqprxPy4zt6btNBfTDjGWLcatEr786yhzjdePwS6w@mail.gmail.com> <alpine.LSU.2.21.2005232118280.4832@anthias.pfeifer.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, May 24, 2020 at 3:40 PM Gerald Pfeifer <gerald@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.jov@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.jov@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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJm2B-kXrGB88k-oFxH2Le2N---fEL_AUHXQdxgoh-hfM9Jz4Q>