Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对于未加载的so,无法正常打开 #17

Open
2361788963 opened this issue Dec 25, 2023 · 1 comment
Open

对于未加载的so,无法正常打开 #17

2361788963 opened this issue Dec 25, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@2361788963
Copy link

xDL Version

2.0.0

Android OS Version

8.1

Android ABIs

armeabi-v7a, arm64-v8a

Device Manufacturers and Models

Nexus 6p

Describe the Bug

执行函数LOGE("xdl_open1 %p",xdl_open("libxxx.so",XDL_TRY_FORCE_LOAD));
我在函数进行了插桩输出
LOGE("xdl_linker_dlopen %p",xdl_linker_dlopen);
LOGE("xdl_linker_load// >= Android 8.0");
LOGE("xdl_linker_caller_addr[%d] %p",i,xdl_linker_caller_addr[i]);
LOGE("xdl_linker_load// >= Android 8.0 handle:%p",handle);
以下是结果
2023-12-25 09:45:52.485 21743-22152 MZHY com.mz.fkrdcg.a233 E xdl_linker_dlopen 0x78514dde3c
2023-12-25 09:45:52.485 21743-22152 MZHY com.mz.fkrdcg.a233 E xdl_linker_load// >= Android 8.0
2023-12-25 09:45:52.485 21743-22152 MZHY com.mz.fkrdcg.a233 E xdl_linker_caller_addr[0] 0x7850649000
2023-12-25 09:45:52.501 21743-22152 MZHY com.mz.fkrdcg.a233 E xdl_linker_caller_addr[1] 0x77cc39e000
2023-12-25 09:45:52.512 21743-22152 MZHY com.mz.fkrdcg.a233 E xdl_linker_caller_addr[2] 0x77c2047000
2023-12-25 09:45:52.513 21743-22152 MZHY com.mz.fkrdcg.a233 E xdl_linker_load// >= Android 8.0 handle:0x0
2023-12-25 09:45:52.513 21743-22152 MZHY com.mz.fkrdcg.a233 E xdl_open1 0x0
可以看到xdl_open返回的是null.

值得一提的是我直接使用dlopen反而还能正常打开so获取handle,先用dlopen打开so,再执行xdl_open也能获取到handle

@2361788963 2361788963 added the bug Something isn't working label Dec 25, 2023
@caikelun
Copy link
Member

caikelun commented Jan 3, 2024

你可能是用 xdl_open 在打开自己app的so库了?这种so需要用默认的dlopen打开,xdl不是用来干这个的。
XDL_TRY_FORCE_LOAD的行为是:先尝试在linker solist中查找已经open的同名库,如果没有找到,则已linker系统namespace作为caller尝试调用dlopen。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants