dll - Cygwin 中的 rebaseall 是做什么的?

标签 dll cygwin

当在 cygwin 中遇到 dll/forking 错误时,我调用 rebaseall 脚本,一切都神奇地再次工作。我知道它以某种方式修改了 cygwin 安装中的 dll,因为我已经在有问题的 dll 和重新设置基础的 dll 之间进行了比较。

它究竟修改了这些二进制文件中的哪些内容并使它们再次工作?

最佳答案

根据Error messages about module base addresses :

DLLs on Windows need to be loaded into memory at non-conflicting base addresses. rebaseall is a cygwin utility that scans all the libraries currently installed and sets each to request a different base address so that none will conflict.

来自 Handling repeated failures of rebaseall to allow cygwin remaps 的更多技术解释:

Because of unix fork semantics (presumably), cygwin libraries must be mapped in the same location in both parent and child of a fork. All cygwin libraries have hints in them as to where they should be mapped in a processes address space; if those hints are followed, each library will be mapped in the same location in both address spaces. However, Windows is perfectly happy mapping a DLL anywhere in the address space; the hint is not considered controlling. The remapping error occurs when a cygwin process starts and one of its libraries cannot be mapped to the location specified by its hint.

/usr/bin/rebaseall changes the DLL hints for all of the cygwin libraries so that there are no inter-library conflicts; it does this by choosing a contiguous but not overlapping library layout starting at a base address and working down. This process makes sure there are no intra-cygwin conflicts, but cannot deal with conflicts with external DLLs that are in cygwin process address spaces (e.g. anti-virus DLLs).

关于dll - Cygwin 中的 rebaseall 是做什么的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33125842/

相关文章:

haskell - 库用户还需要编译库所需的静态 .lib 吗?

java - BASH 控制序列解析器或正则表达式?

Cygwin scp 目录路径

c++ - 如何在 Windows 上安装 GMP Mp? (C++)

android - 在 ffmpeg 中使用 build_libstagefright 为 android 构建文件 .so

python - py2exe - 如何减少 dll 依赖性?

c++ - Visual Studio 2008 : Use external Debug-DLL for Debug-Run and external Release-DLL for Release-Run

php - 缺少扩展名 : openssl Message could not be sent

c++ - 在 C++ 中将列表作为属性传递

cmake - 如何告诉 CMake 使用 Windows 路径,而不是 Cygwin 路径?