[php-src] PR #16351: FFI: support symbol lookup without specifying lib on Windows
| From: | cmb69 | Date: | Thu, 10 Oct 2024 22:04:07 +0000 |
| Subject: | [php-src] PR #16351: FFI: support symbol lookup without specifying lib on Windows | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-29142@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16351
Author: cmb69
This works similar to
dlsym(RTLD_DEFAULT, …) with the caveat that symbols on Windows
may not be unique, and are usually qualified by the module they are exported from. That means that
wrong symbols may be fetched, potentially causing serious issues; therefore this usage is not
recommended for production purposes, but is a nice simplification for quick experiments and the
ext/ffi test suite.
---
Note that a particular example for where this shouldn't be used is gh14626.phpt which uses
malloc() which is, contrary to skip reason, available on Windows easily multiple times
(I had it in a debug build in ucrtbase.dll, ucrtbased.dll and msvcrt.dll at least).