Skip to content

Commit

Permalink
use -wrap for exit
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxSH committed Apr 27, 2020
1 parent fb17850 commit ced78cb
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sysmodules/loader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sysmodules/loader/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sysmodules/pm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sysmodules/pm/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sysmodules/pxi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sysmodules/pxi/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion sysmodules/rosalina/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sysmodules/rosalina/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sysmodules/sm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sysmodules/sm/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ced78cb

Please sign in to comment.