Module: wine Branch: master Commit: 6d829f2baf156738326acc77548b37c90024a93c URL: https://source.winehq.org/git/wine.git/?a=commit;h=6d829f2baf156738326acc775...
Author: Damjan Jovanovic damjan.jov@gmail.com Date: Mon Nov 30 20:08:01 2020 +0200
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
---
dlls/ntdll/unix/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 0e827315ac3..72f215eb2d3 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -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)