Skip to content

Commit

Permalink
MUSL fix; strcmp for boostrapper on different musl platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Gunnarsson committed Sep 17, 2024
1 parent 2d99088 commit f49ce0d
Showing 1 changed file with 6 additions and 2 deletions.
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, "ld-musl") ||
frida_str_has_prefix (name, "libc.musl");
}

static ssize_t
Expand Down

0 comments on commit f49ce0d

Please sign in to comment.