[Bug 49139] Regression: Wine crashes on startup on FreeBSD >= 5.7

WineHQ Bugzilla wine-bugs at winehq.org
Sun May 17 13:46:32 CDT 2020


https://bugs.winehq.org/show_bug.cgi?id=49139

--- Comment #11 from Damjan Jovanovic <damjan.jov at gmail.com> ---
(In reply to Alex S from comment #10)
> (In reply to Damjan Jovanovic from comment #6)
> > ie. GNU's l_addr is FreeBSD's l_offs
> 
> That sounds like a positively nasty footgun. I wonder what else is broken
> (besides Wine).
> 
> > Solaris's man page sounds the same as FreeBSD's
> > (https://docs.oracle.com/cd/E36784_01/html/E36874/dlinfo-3c.html), and I
> > haven't been able to find the source for OpenIndiana's dynamic linker yet to
> > prove otherwise.
> 
> I believe the code somewhere around
> https://github.com/illumos/illumos-gate/blob/
> 67d74cc3e7c9d9461311136a0b2069813a3fd927/usr/src/cmd/sgs/rtld/common/elf.
> c#L1733 (the ADDR macro is defined at
> https://github.com/illumos/illumos-gate/blob/
> 4e0c5eff9af325c80994e9527b7cb8b3a1ffd1d4/usr/src/cmd/sgs/include/rtld.
> h#L889). I'm a bit lost in it, to be honest.

DT_INIT has to add the "relocbase" offset to the pointer, so whatever it is
adding, is the relocbase:

---snip---
            case DT_INIT:
                if (dyn->d_un.d_ptr != 0)
                    INIT(lmp) =
                        (void (*)())(dyn->d_un.d_ptr +
                        base);
                break;
---snip---

ie. here, "base" = relocbase.
Where did "base" come from?

---snip---
    if (ehdr->e_type == ET_EXEC)
        base = 0;
    else
        base = addr;
---snip---

And what is written into l_addr?

---snip---
    ADDR(lmp) = addr;
---snip---

where:

---snip---
#define    ADDR(X)        ((X)->rt_public.l_addr)
---snip---


So if I am reading that correctly, OpenIndiana returns the relocbase in
link_map.l_addr like GNU and NetBSD.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list