LDChen
July 18th, 2005, 18:31
Hello.
I tried to compile my emulator with DevKitPSP-R3 but I have some problems.
I have successfully compiled my code but I have some problems with linking.
I attached here the console output.
pspobj/bios.o: In function `HLE_console_read':
bios.c:(.text+0xcf8): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/bios.o: In function `HLE_console_write':
bios.c:(.text+0xdb0): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0xdd0): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0xe0c): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/bios.o: In function `BIOS_getchar':
bios.c:(.text+0x31a0): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/bios.o: In function `BIOS_putchar':
bios.c:(.text+0x3210): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0x3238): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0x3270): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/hle_0004.o: In function `HLE_Formatted_Write':
hle_0004.c:(.text+0x74): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
hle_0004.c:(.text+0x98): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
hle_0004.c:(.text+0x100): additional relocation overflows omitted from the output
c:/devkitpsp/psp/sdk/lib\libpspdebug.a(scr_printf.o): In function `pspDebugScreenInit':
c:\projects\devkitPro\buildscripts\pspsdk-1.0+beta\sdk\debug/scr_printf.c:47: undefined reference to `sceGeEdramGetAddr'
c:\projects\devkitPro\buildscripts\pspsdk-1.0+beta\sdk\debug/scr_printf.c:48: undefined reference to `sceDisplaySetMode'
c:\projects\devkitPro\buildscripts\pspsdk-1.0+beta\sdk\debug/scr_printf.c:49: undefined reference to `sceDisplaySetFrameBuf'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(fstatr.o): In function `_fstat_r':
fstatr.c:(.text+0x20): undefined reference to `_fstat'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(makebuf.o): In function `__smakebuf':
makebuf.c:(.text+0xf0): undefined reference to `isatty'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(openr.o): In function `_open_r':
openr.c:(.text+0x24): undefined reference to `_open'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x1c): undefined reference to `_sbrk'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(writer.o): In function `_write_r':
writer.c:(.text+0x24): undefined reference to `_write'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(closer.o): In function `_close_r':
closer.c:(.text+0x1c): undefined reference to `_close'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(lseekr.o): In function `_lseek_r':
lseekr.c:(.text+0x24): undefined reference to `_lseek'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(readr.o): In function `_read_r':
readr.c:(.text+0x24): undefined reference to `_read'
collect2: ld returned 1 exit status
C:\DEVKIT~3\BIN\MAKE.EXE: *** [pspfpse.elf] Error 1
The relocation errors aren't a problem, I just need to understand why the GOT overflows so easily.
The true problems are the missing functions.
Should I write the UNISTD functions myself?
The 'sce' stubs are also missing.
I'm linking with "-lc -lpspglue -lpspkernel -lpspdebug" libraries.
The stubs seem to be into "psplibc" but I can't use it because it makes conflicts with other functions into the libc.
If I use psplibc instead of libc, I have much more errors because there are many functions not implemented.
All suggestions are appreciated, thanks in advance.
Sincerely,
LDChen.
I tried to compile my emulator with DevKitPSP-R3 but I have some problems.
I have successfully compiled my code but I have some problems with linking.
I attached here the console output.
pspobj/bios.o: In function `HLE_console_read':
bios.c:(.text+0xcf8): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/bios.o: In function `HLE_console_write':
bios.c:(.text+0xdb0): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0xdd0): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0xe0c): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/bios.o: In function `BIOS_getchar':
bios.c:(.text+0x31a0): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/bios.o: In function `BIOS_putchar':
bios.c:(.text+0x3210): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0x3238): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0x3270): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/hle_0004.o: In function `HLE_Formatted_Write':
hle_0004.c:(.text+0x74): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
hle_0004.c:(.text+0x98): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
hle_0004.c:(.text+0x100): additional relocation overflows omitted from the output
c:/devkitpsp/psp/sdk/lib\libpspdebug.a(scr_printf.o): In function `pspDebugScreenInit':
c:\projects\devkitPro\buildscripts\pspsdk-1.0+beta\sdk\debug/scr_printf.c:47: undefined reference to `sceGeEdramGetAddr'
c:\projects\devkitPro\buildscripts\pspsdk-1.0+beta\sdk\debug/scr_printf.c:48: undefined reference to `sceDisplaySetMode'
c:\projects\devkitPro\buildscripts\pspsdk-1.0+beta\sdk\debug/scr_printf.c:49: undefined reference to `sceDisplaySetFrameBuf'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(fstatr.o): In function `_fstat_r':
fstatr.c:(.text+0x20): undefined reference to `_fstat'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(makebuf.o): In function `__smakebuf':
makebuf.c:(.text+0xf0): undefined reference to `isatty'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(openr.o): In function `_open_r':
openr.c:(.text+0x24): undefined reference to `_open'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x1c): undefined reference to `_sbrk'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(writer.o): In function `_write_r':
writer.c:(.text+0x24): undefined reference to `_write'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(closer.o): In function `_close_r':
closer.c:(.text+0x1c): undefined reference to `_close'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(lseekr.o): In function `_lseek_r':
lseekr.c:(.text+0x24): undefined reference to `_lseek'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(readr.o): In function `_read_r':
readr.c:(.text+0x24): undefined reference to `_read'
collect2: ld returned 1 exit status
C:\DEVKIT~3\BIN\MAKE.EXE: *** [pspfpse.elf] Error 1
The relocation errors aren't a problem, I just need to understand why the GOT overflows so easily.
The true problems are the missing functions.
Should I write the UNISTD functions myself?
The 'sce' stubs are also missing.
I'm linking with "-lc -lpspglue -lpspkernel -lpspdebug" libraries.
The stubs seem to be into "psplibc" but I can't use it because it makes conflicts with other functions into the libc.
If I use psplibc instead of libc, I have much more errors because there are many functions not implemented.
All suggestions are appreciated, thanks in advance.
Sincerely,
LDChen.