$(TARGET_S): LDFLAGS += -Wl,-T script_$(ARCH).lds
$(TARGET_D): LDFLAGS += -ldl -Wl,--version-script=ginge_dyn.symver
+$(TARGET_D): LDFLAGS += -Wl,--no-undefined
$(TARGET_S): $(OBJ_S)
$(CC) -o $@ $^ -static $(LDFLAGS)
#include "host_wiz.c"
#endif
+char **g_argv;
+
int host_init(void)
{
in_init();
printf("forced exit...\n");
- snprintf(cmd, sizeof(cmd), "killall %s", g_argv[0]);
- system(cmd);
- usleep(300000);
- snprintf(cmd, sizeof(cmd), "killall -9 %s", g_argv[0]);
- system(cmd);
+ if (g_argv != NULL) {
+ snprintf(cmd, sizeof(cmd), "killall %s", g_argv[0]);
+ system(cmd);
+ usleep(300000);
+ snprintf(cmd, sizeof(cmd), "killall -9 %s", g_argv[0]);
+ system(cmd);
+ }
exit(status);
}
{
long ret;
+#ifndef DL
if (path != NULL && strncmp(path, "/proc/", 6) == 0
&& strcmp(strrchr(path, '/'), "/exe") == 0)
{
ret = bufsiz;
}
else
+#endif
ret = g_readlink_raw(path, buf, bufsiz);
strace("readlink(%s, %s, %zd) = %ld\n", path, buf, bufsiz, ret);