diff --git a/crt/Makefile b/crt/Makefile index e349a17..f6e3df9 100644 --- a/crt/Makefile +++ b/crt/Makefile @@ -34,7 +34,7 @@ CFLAGS += -ffreestanding -fno-builtin -nostdlib -fPIC CFLAGS += -target x86_64-sie-ps5 -fno-plt -fno-stack-protector CFLAGS += -fvisibility-nodllstorageclass=default -Wall -Werror CFLAGS += -fms-extensions -Wno-microsoft-anon-tag -CFLAGS += -g +CFLAGS += -O1 OBJ := crt.o syscall.o klog.o nid.o kernel.o rtld.o rtld_so.o rtld_sprx.o \ rtld_payload.o patch.o mdbg.o diff --git a/crt/crt.c b/crt/crt.c index a974e22..a44ca2f 100644 --- a/crt/crt.c +++ b/crt/crt.c @@ -111,7 +111,7 @@ terminate(payload_args_t *args) { /** * Entry-point invoked by the ELF loader. **/ -void +int _start(payload_args_t *args) { char** (*getargv)(void) = 0; int (*getargc)(void) = 0; @@ -127,8 +127,7 @@ _start(payload_args_t *args) { // Init runtime. if((*args->payloadout=pre_init(args))) { - terminate(args); - return; + return terminate(args); } // Obtain argc, argv and envp from libkernel. @@ -154,5 +153,5 @@ _start(payload_args_t *args) { __fini_array_start[count-i-1](); } - terminate(args); + return terminate(args); } diff --git a/libc/Makefile b/libc/Makefile index 79af031..6343be2 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -33,6 +33,7 @@ endif CFLAGS := -target x86_64-sie-ps5 -fPIC -fno-plt -fno-stack-protector CFLAGS += -nobuiltininc -isystem ../include/freebsd CFLAGS += -fvisibility-nodllstorageclass=default +CFLAGS += -O1 SRCS := $(wildcard *.c) OBJS := $(SRCS:.c=.o)