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

linux: Improve injector's MUSL compatibility #546

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/linux/helpers/bootstrapper-arm.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-arm64.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-mips.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-mips64.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-mips64el.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-mipsel.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-x86.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-x86_64.bin
Binary file not shown.
8 changes: 6 additions & 2 deletions src/linux/helpers/bootstrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,9 @@ frida_infer_rtld_flavor_from_filename (const char * name)
if (frida_str_has_prefix (name, "ld-uClibc"))
return FRIDA_RTLD_UCLIBC;

if (strcmp (name, "libc.so") == 0)
if (strcmp (name, "libc.so") == 0 ||
frida_str_has_prefix (name, "libc.musl") ||
frida_str_has_prefix (name, "ld-musl"))
return FRIDA_RTLD_MUSL;

if (strcmp (name, "ld-android.so") == 0)
Expand Down Expand Up @@ -607,7 +609,9 @@ frida_path_is_libc (const char * path, FridaRtldFlavor rtld_flavor)
else
name = path;

return frida_str_has_prefix (name, "libc.so");
return frida_str_has_prefix (name, "libc.so") ||
frida_str_has_prefix (name, "libc.musl") ||
frida_str_has_prefix (name, "ld-musl");
}

static ssize_t
Expand Down
Loading