From f8f252343c1fe37c753596d481b6872799e2f109 Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Mon, 22 Jun 2020 21:24:12 +0200 Subject: [PATCH 1/3] Cleanup some compiler warnings --- src/libc/string.c | 2 +- src/startup/crt0.c | 2 +- src/startup/prxexports.c | 6 +++--- tools/psp-fixup-imports.c | 2 -- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libc/string.c b/src/libc/string.c index 50406941..cf9f7e3e 100644 --- a/src/libc/string.c +++ b/src/libc/string.c @@ -454,7 +454,7 @@ char * strstr(const char * string, const char * substring) { char* strpos; - if (string == 0) + if (*string == 0) return 0; if (strlen(substring)==0) diff --git a/src/startup/crt0.c b/src/startup/crt0.c index 071f740e..1501eeb7 100644 --- a/src/startup/crt0.c +++ b/src/startup/crt0.c @@ -168,5 +168,5 @@ static const struct _library_entry { unsigned short funcCount; void * entrytable; } _library_entry __attribute__((section(".lib.ent"), used)) = { - NULL, 0, 0x8000, 4, 1, 1, &__entrytable + NULL, 0, 0x8000, 4, 1, 1, (unsigned int *) &__entrytable }; diff --git a/src/startup/prxexports.c b/src/startup/prxexports.c index a101f0ff..f975ebc4 100644 --- a/src/startup/prxexports.c +++ b/src/startup/prxexports.c @@ -11,8 +11,8 @@ #include #define NULL ((void *) 0) -void extern module_start; -void extern module_info; +extern int module_start; +extern struct SceModuleInfo module_info; static const unsigned int __syslib_exports[4] __attribute__((section(".rodata.sceResident"))) = { 0xD632ACDB, 0xF01D73A7, @@ -21,5 +21,5 @@ static const unsigned int __syslib_exports[4] __attribute__((section(".rodata.sc }; const struct _PspLibraryEntry __library_exports[1] __attribute__((section(".lib.ent"), used)) = { - { NULL, 0x0000, 0x8000, 4, 1, 1, &__syslib_exports }, + { NULL, 0x0000, 0x8000, 4, 1, 1, (unsigned int *) &__syslib_exports }, }; diff --git a/tools/psp-fixup-imports.c b/tools/psp-fixup-imports.c index d67bb081..c9d838b6 100644 --- a/tools/psp-fixup-imports.c +++ b/tools/psp-fixup-imports.c @@ -283,7 +283,6 @@ int validate_header(unsigned char *data) int load_sections(unsigned char *data) { int ret = 0; - int found_rel = 0; unsigned int load_addr = 0xFFFFFFFF; if(g_elfhead.iShnum > 0) @@ -336,7 +335,6 @@ int load_sections(unsigned char *data) && (g_elfsections[g_elfsections[i].iInfo].iFlags & SHF_ALLOC)) { g_elfsections[i].pRef = &g_elfsections[g_elfsections[i].iInfo]; - found_rel = 1; } } From 3cfacc675da90a2b49d923d7ad0825c4867f5d7b Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Tue, 23 Jun 2020 00:20:51 +0200 Subject: [PATCH 2/3] Fix duplicated stub functions --- src/rtc/sceRtc.S | 3 --- src/rtc/sceRtc_driver.S | 7 ++----- src/vsh/scePaf.S | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/rtc/sceRtc.S b/src/rtc/sceRtc.S index 59ce3c9e..b040e27b 100644 --- a/src/rtc/sceRtc.S +++ b/src/rtc/sceRtc.S @@ -123,9 +123,6 @@ IMPORT_FUNC "sceRtc",0x62685E98,sceRtcGetLastAdjustedTime #endif #ifdef F_sceRtc_0040 - IMPORT_FUNC "sceRtc",0xDFBC5F16,sceRtcParseDateTime -#endif -#ifdef F_sceRtc_0041 IMPORT_FUNC "sceRtc",0xE1C93E47,sceRtcGetTime64_t #endif diff --git a/src/rtc/sceRtc_driver.S b/src/rtc/sceRtc_driver.S index ef94bdb8..c26625dc 100644 --- a/src/rtc/sceRtc_driver.S +++ b/src/rtc/sceRtc_driver.S @@ -162,15 +162,12 @@ IMPORT_FUNC "sceRtc_driver",0xCE27DE2F,sceRtcEnd #endif #ifdef F_sceRtc_driver_0053 - IMPORT_FUNC "sceRtc_driver",0xDFBC5F16,sceRtcParseDateTime -#endif -#ifdef F_sceRtc_driver_0054 IMPORT_FUNC "sceRtc_driver",0xE1C93E47,sceRtcGetTime64_t #endif -#ifdef F_sceRtc_driver_0055 +#ifdef F_sceRtc_driver_0054 IMPORT_FUNC "sceRtc_driver",0xF0B5571C,sceRtcSynchronize #endif -#ifdef F_sceRtc_driver_0056 +#ifdef F_sceRtc_driver_0055 IMPORT_FUNC "sceRtc_driver",0xFB3B18CD,sceRtc_driver_FB3B18CD #endif diff --git a/src/vsh/scePaf.S b/src/vsh/scePaf.S index 19557943..b14808da 100644 --- a/src/vsh/scePaf.S +++ b/src/vsh/scePaf.S @@ -2025,7 +2025,7 @@ IMPORT_FUNC "scePaf",0x10F3BB61,memset #endif #ifdef F_scePaf_0674 - IMPORT_FUNC "scePaf",0x81D0D1F7,memcpy + IMPORT_FUNC "scePaf",0x81D0D1F7,memcmp #endif #ifdef F_scePaf_0675 IMPORT_FUNC "scePaf",0x7EDCC45E,floorf From 14c5b3f6ba63cd2dc7c4122326e5c5d88406e684 Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Wed, 24 Jun 2020 18:02:19 +0200 Subject: [PATCH 3/3] Fix warning when exporting stubs --- tools/psp-build-exports.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/psp-build-exports.c b/tools/psp-build-exports.c index 129f6c48..e0ac4b08 100644 --- a/tools/psp-build-exports.c +++ b/tools/psp-build-exports.c @@ -405,7 +405,7 @@ void build_exports(void) fprintf(stdout, "\t{ \"%s\", ", pLib->name); } - fprintf(stdout, "0x%04X, 0x%04X, 4, %d, %d, &__%s_exports },\n", pLib->ver, pLib->attr, + fprintf(stdout, "0x%04X, 0x%04X, 4, %d, %d, (unsigned int *) &__%s_exports },\n", pLib->ver, pLib->attr, pLib->varCount, pLib->funcCount, pLib->name); pLib = pLib->pNext;