基本上定位出来原因了,处理一下

This commit is contained in:
anod 2023-03-12 08:15:42 +08:00
parent 7064aeefd0
commit 3717c3184e
2 changed files with 3 additions and 8 deletions

View File

@ -46,13 +46,12 @@ CXXFLAGS := $(ARCH) -std=c++17 -O2 -flto -gdwarf-4 -fno-rtti -fno-exceptions \
-mword-relocations -ffunction-sections -fno-math-errno -Wall -Wextra -mword-relocations -ffunction-sections -fno-math-errno -Wall -Wextra
CXXFLAGS += $(INCLUDE) $(DEFINES) CXXFLAGS += $(INCLUDE) $(DEFINES)
ASFLAGS := $(ARCH) -gdwarf-4 -flto $(INCLUDE) $(DEFINES) ASFLAGS := $(ARCH) -gdwarf-4 $(INCLUDE) $(DEFINES)
LDFLAGS = $(ARCH) -gdwarf-4 -flto -specs=../arm11.specs -Wl,-Map,$(notdir $*.map) -nostartfiles LDFLAGS = $(ARCH) -gdwarf-4 -flto -specs=../arm11.specs -Wl,-Map,$(notdir $*.map) -nostartfiles
ifeq ($(strip $(NO_DEBUG)),) ifeq ($(strip $(NO_DEBUG)),)
CFLAGS := $(subst -flto,,$(CFLAGS)) -fstack-protector-strong -fno-inline CFLAGS := $(subst -flto,,$(CFLAGS)) -fstack-protector-strong -fno-inline
CXXFLAGS := $(subst -flto,,$(CXXFLAGS)) -fstack-protector-strong -fno-inline CXXFLAGS := $(subst -flto,,$(CXXFLAGS)) -fstack-protector-strong -fno-inline
ASFLAGS := $(subst -flto,,$(ASFLAGS))
LDFLAGS := $(subst -flto,,$(LDFLAGS)) -fstack-protector-strong -fno-inline -Wl,-wrap=malloc,-wrap=calloc,-wrap=free LDFLAGS := $(subst -flto,,$(LDFLAGS)) -fstack-protector-strong -fno-inline -Wl,-wrap=malloc,-wrap=calloc,-wrap=free
endif endif

View File

@ -39,7 +39,6 @@ typedef struct
static CheatLib gblcht = {0, 0, NULL, 0, 0}; static CheatLib gblcht = {0, 0, NULL, 0, 0};
static CheatSet gblset = {0, 0, {0,0,0}, NULL, NULL}; static CheatSet gblset = {0, 0, {0,0,0}, NULL, NULL};
//static char freemem[1024*8];
#define ACL_MAGIC_CODE 0x4c4341 #define ACL_MAGIC_CODE 0x4c4341
#define ACL_GBA_CODELEN 4 #define ACL_GBA_CODELEN 4
@ -136,8 +135,6 @@ acl_error_t acl_close_lib( void )
static int32_t bin_search( FHandle fd, acl_text_t game ) static int32_t bin_search( FHandle fd, acl_text_t game )
{ {
extern void log( const char *, ... );
if( RES_OK != fLseek(fd, ACL_HEADER_LEN) ){ if( RES_OK != fLseek(fd, ACL_HEADER_LEN) ){
return -ACHTLIB_INVALID; return -ACHTLIB_INVALID;
} }
@ -146,7 +143,7 @@ static int32_t bin_search( FHandle fd, acl_text_t game )
char *serials = (char*)malloc( size ); char *serials = (char*)malloc( size );
if( serials == NULL ){ if( serials == NULL ){
return -ACHTLIB_NOMEM; return -ACHTLIB_NOMEM;
}log("alloc serial: %08x with size: %d", serials, size); }
uint32_t readed; uint32_t readed;
if( RES_OK != fReadSize(fd, serials, size, &readed) if( RES_OK != fReadSize(fd, serials, size, &readed)
@ -173,9 +170,8 @@ static int32_t bin_search( FHandle fd, acl_text_t game )
start = mid + 1; start = mid + 1;
} }
else end = mid - 1; else end = mid - 1;
}log("free serial: %08x", serials); }
free( serials ); free( serials );
log("after free");
return found < 0 ? -ACHTLIB_NOT_FOUND : found; return found < 0 ? -ACHTLIB_NOT_FOUND : found;
} }