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

why depends so libs not load when debug the so with edb-debugger #566

Open
unpackerbai opened this Issue Jul 14, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@unpackerbai

unpackerbai commented Jul 14, 2017

No description provided.

@eteran eteran added the question label Jul 14, 2017

@eteran

This comment has been minimized.

Show comment
Hide comment
@eteran

eteran Jul 14, 2017

Owner

@unpackerbai I assume English is not your primary language, I am having a hard time understanding your question :-/

I think you are asking why shared libraries (.so files) of a program being debugged by edb aren't loaded? Is that your question?

The answer is that they ARE loaded. However, they aren't loaded right away. When you first launch a program, essentially only a version of ld (the library) and your program are loaded. And the code starts inside ld itself. ld then loads the dependent libraries and eventually gives control to the main of your program.

It is possible that some libraries are lazy loaded, or loaded at run-time. But for the most common scenarios, dependent libraries should be loaded by the time you reach main.

Does this answer your question?

Owner

eteran commented Jul 14, 2017

@unpackerbai I assume English is not your primary language, I am having a hard time understanding your question :-/

I think you are asking why shared libraries (.so files) of a program being debugged by edb aren't loaded? Is that your question?

The answer is that they ARE loaded. However, they aren't loaded right away. When you first launch a program, essentially only a version of ld (the library) and your program are loaded. And the code starts inside ld itself. ld then loads the dependent libraries and eventually gives control to the main of your program.

It is possible that some libraries are lazy loaded, or loaded at run-time. But for the most common scenarios, dependent libraries should be loaded by the time you reach main.

Does this answer your question?

@unpackerbai

This comment has been minimized.

Show comment
Hide comment
@unpackerbai

unpackerbai Jul 14, 2017

yes,i am chinese.
i means that, a shared library(let's call it A), needed other .so files. when debugging A, needed .so files not loaded in edb.But I write a .o file, code : dlopen("./A", RTLD_NOW), the needed .so files which A need can be loaded in edb..

unpackerbai commented Jul 14, 2017

yes,i am chinese.
i means that, a shared library(let's call it A), needed other .so files. when debugging A, needed .so files not loaded in edb.But I write a .o file, code : dlopen("./A", RTLD_NOW), the needed .so files which A need can be loaded in edb..

@eteran

This comment has been minimized.

Show comment
Hide comment
@eteran

eteran Jul 15, 2017

Owner

If your program uses dlopen, then the system should load any dependant libraries.

Can you provide a simple example of it not working.

Owner

eteran commented Jul 15, 2017

If your program uses dlopen, then the system should load any dependant libraries.

Can you provide a simple example of it not working.

@unpackerbai

This comment has been minimized.

Show comment
Hide comment
@unpackerbai

unpackerbai Jul 17, 2017

ok, how to contact with you?

unpackerbai commented Jul 17, 2017

ok, how to contact with you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment