Commit f728a5f3 authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

ntdll: Interpretation of l_addr depends on FreeBSD version.

FreeBSD changed l_addr to mean the relocation offset like it does on other OSes, and provided a dynamic linker symbol, "_rtld_version_laddr_offset", that can be used to check the meaning. Signed-off-by: 's avatarDamjan Jovanovic <damjan.jov@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent fed3784a
......@@ -1372,8 +1372,10 @@ static void call_constructors( WINE_MODREF *wm )
{
caddr_t relocbase = (caddr_t)map->l_addr;
#ifdef __FreeBSD__ /* FreeBSD doesn't relocate l_addr */
if (!get_relocbase(map->l_addr, &relocbase)) return;
#ifdef __FreeBSD__
/* On older FreeBSD versions, l_addr was the absolute load address, now it's the relocation offset. */
if (!dlsym(RTLD_DEFAULT, "_rtld_version_laddr_offset"))
if (!get_relocbase(map->l_addr, &relocbase)) return;
#endif
switch (dyn->d_tag)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment