ntdll: Fix backward compatibility for struct link_map on FreeBSD.

Checking for the _rtld_version_laddr_offset symbol only works when
header and library versions match. Checking for the offset of l_addr
instead lets us use the older header with the new library too.

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Damjan Jovanovic 2020-11-30 20:08:01 +02:00 committed by Alexandre Julliard
parent 50650d6e94
commit 6d829f2baf
1 changed files with 1 additions and 1 deletions

View File

@ -1417,7 +1417,7 @@ found:
#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 (offsetof(struct link_map, l_addr) == 0)
if (!get_relocbase(map->l_addr, &relocbase)) return;
#endif
switch (dyn->d_tag)