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

DLSYM #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

DLSYM #6

wants to merge 2 commits into from

Conversation

passgat
Copy link

@passgat passgat commented Apr 6, 2022

Fix symbol loading

It prints "Failed to load symbol" instead of a too much generic and
misleading message "File not found".

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
As reported by Linux man page:
"In unusual cases the value of the symbol returned by dlsym() could be
NULL. Therefore, a NULL return from dlsym() need not indicate an error.
The correct way to distinguish an error from a symbol whose value is
NULL is to call dlerror(3) to clear any old error conditions, then call
dlsym(), and then call dlerror() again, saving its return value into a
variable, and check whether this saved value is not NULL."

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant