From ced78cb072a8605bc23f6002b954ea62ed956219 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Mon, 27 Apr 2020 01:07:57 +0100 Subject: [PATCH] use -wrap for exit --- sysmodules/loader/Makefile | 2 +- sysmodules/loader/source/main.c | 2 +- sysmodules/pm/Makefile | 2 +- sysmodules/pm/source/main.c | 2 +- sysmodules/pxi/Makefile | 2 +- sysmodules/pxi/source/main.c | 2 +- sysmodules/rosalina/Makefile | 2 +- sysmodules/rosalina/source/main.c | 2 +- sysmodules/sm/Makefile | 2 +- sysmodules/sm/source/main.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sysmodules/loader/Makefile b/sysmodules/loader/Makefile index c24cde7..7b88dba 100755 --- a/sysmodules/loader/Makefile +++ b/sysmodules/loader/Makefile @@ -37,7 +37,7 @@ CFLAGS := -std=gnu11 $(COMMON_FLAGS) CXXFLAGS := -fno-rtti -fno-exceptions -std=gnu++17 $(COMMON_FLAGS) ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),--section-start,.text=0x14000000 +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit,--section-start,.text=0x14000000 LIBS := -lctru diff --git a/sysmodules/loader/source/main.c b/sysmodules/loader/source/main.c index e3d3a03..7966312 100644 --- a/sysmodules/loader/source/main.c +++ b/sysmodules/loader/source/main.c @@ -47,7 +47,7 @@ static inline void loadCFWInfo(void) void __ctru_exit(int rc) { (void)rc; } // needed to avoid linking error // this is called after main exits -void exit(int rc) +void __wrap_exit(int rc) { (void)rc; // Not supposed to terminate... kernel will clean up the handles if it does happen anyway diff --git a/sysmodules/pm/Makefile b/sysmodules/pm/Makefile index 63ba36f..fa49ced 100644 --- a/sysmodules/pm/Makefile +++ b/sysmodules/pm/Makefile @@ -37,7 +37,7 @@ CFLAGS += $(INCLUDE) CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit LIBS := -lctru diff --git a/sysmodules/pm/source/main.c b/sysmodules/pm/source/main.c index 07fbf38..37fbb00 100644 --- a/sysmodules/pm/source/main.c +++ b/sysmodules/pm/source/main.c @@ -19,7 +19,7 @@ static u8 ALIGN(8) exheaderInfoBuffer[6 * sizeof(ExHeader_Info)] = {0}; static u8 ALIGN(8) threadStacks[2][THREAD_STACK_SIZE] = {0}; // this is called after main exits -void exit(int rc) +void __wrap_exit(int rc) { (void)rc; // Not supposed to terminate... kernel will clean up the handles if it does happen anyway diff --git a/sysmodules/pxi/Makefile b/sysmodules/pxi/Makefile index b14d489..b729039 100644 --- a/sysmodules/pxi/Makefile +++ b/sysmodules/pxi/Makefile @@ -37,7 +37,7 @@ CFLAGS += $(INCLUDE) CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit LIBS := -lctru diff --git a/sysmodules/pxi/source/main.c b/sysmodules/pxi/source/main.c index 8c9194e..e0b91ad 100644 --- a/sysmodules/pxi/source/main.c +++ b/sysmodules/pxi/source/main.c @@ -107,7 +107,7 @@ void __libc_init_array(void); void __ctru_exit(int rc) { (void)rc; } // needed to avoid linking error // this is called after main exits -void exit(int rc) +void __wrap_exit(int rc) { (void)rc; diff --git a/sysmodules/rosalina/Makefile b/sysmodules/rosalina/Makefile index e88238b..06a2131 100644 --- a/sysmodules/rosalina/Makefile +++ b/sysmodules/rosalina/Makefile @@ -37,7 +37,7 @@ CFLAGS += $(INCLUDE) CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),--section-start,.text=0x14000000 +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit,--section-start,.text=0x14000000 LIBS := -lctru diff --git a/sysmodules/rosalina/source/main.c b/sysmodules/rosalina/source/main.c index 7fd0317..6a25c15 100644 --- a/sysmodules/rosalina/source/main.c +++ b/sysmodules/rosalina/source/main.c @@ -84,7 +84,7 @@ void __libc_fini_array(void); void __ctru_exit(int rc) { (void)rc; } // needed to avoid linking error // this is called after main exits -void exit(int rc) +void __wrap_exit(int rc) { (void)rc; // TODO: make pm terminate rosalina diff --git a/sysmodules/sm/Makefile b/sysmodules/sm/Makefile index 63ba36f..fa49ced 100644 --- a/sysmodules/sm/Makefile +++ b/sysmodules/sm/Makefile @@ -37,7 +37,7 @@ CFLAGS += $(INCLUDE) CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit LIBS := -lctru diff --git a/sysmodules/sm/source/main.c b/sysmodules/sm/source/main.c index c37f5aa..28961f0 100644 --- a/sysmodules/sm/source/main.c +++ b/sysmodules/sm/source/main.c @@ -27,7 +27,7 @@ static u8 ALIGN(4) serviceAccessListStaticBuffer[0x110]; void __ctru_exit(int rc) { (void)rc; } // needed to avoid linking error // this is called after main exits -void exit(int rc) +void __wrap_exit(int rc) { (void)rc; // Not supposed to terminate... kernel will clean up the handles if it does happen anyway