diff --git a/elf/mold-wrapper.c b/elf/mold-wrapper.c index 35e55c6e1f..73fbeda710 100644 --- a/elf/mold-wrapper.c +++ b/elf/mold-wrapper.c @@ -132,3 +132,14 @@ int posix_spawn(pid_t *pid, const char *path, typeof(posix_spawn) *real = dlsym(RTLD_NEXT, "posix_spawn"); return real(pid, path, file_actions, attrp, argv, envp); } + +int posix_spawnp(pid_t *pid, const char *file, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, + char *const *argv, char *const *envp) { + debug_print("posix_spawnp %s\n", file); + if (!strcmp(file, "ld") || is_ld(file)) + file = get_mold_path(); + typeof(posix_spawnp) *real = dlsym(RTLD_NEXT, "posix_spawnp"); + return real(pid, file, file_actions, attrp, argv, envp); +}