符号版本和对dlsym [英] symbol versioning and dlsym
问题描述
我使用加载pthread库在我的程序的dlopen
,并获取处理程序在pthread_create
和在pthread_join
使用则dlsym
。
I load the pthread library in my program using dlopen
, and fetch handlers to pthread_create
and pthread_join
using dlsym
.
我怎么能保证,无论是处理程序的兼容版本?我不在乎,如果符号的新版本或旧版本。我只是想,不管在pthread_create
我用用好工作在pthread_join
,我得到的。
How can I ensure that both the handlers are of a compatible version? I do not care if the symbols are of new version or old versions. I just want that whatever pthread_create
I use to work well with the pthread_join
that I get.
我知道有一个 dlvsym
来,我可以通过明确的版本号,但我不关心具体的版本号,因为我希望我的code是独立库的版本。
I know there is a dlvsym
to which I can pass explicit version number, but I do not care about exact version numbers as I want my code to be independent of library versions.
推荐答案
该版本存在的唯一理由是在ABI兼容性差的企图与反对的古的glibc的版本编译的程序,这将没有实际工作反正。 (他们已经在某种程度上,据我可以告诉大家,不能兼容默默打破ABI至少一次。)只是忽略它。
The only reason the versioning exists is for a poor attempt at ABI-compatibility with programs compiled against ancient versions of glibc, which will not actually work anyway. (They've silently broken the ABI at least once in a way that, as far as I can tell, cannot be compatible.) Just ignore it.
这篇关于符号版本和对dlsym的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!