hello world in mips asm for the psp cf > 1.5
my program is compiled with
psp-as main.s -o main.o
psp-ld main.o -o main.elf
psp-fiximport main.elf
psp-prxgen main.elf main.prx
But i've got a error withe the psp-prxgen it complain about a section .rel.text not found can somebody explain me or point me to a documentation about this section
i have imported a dummy function LoadExecForKernel to avoid error with
psp-fiximport and also to see how to do this in the future
Code: Select all
.macro IMPORT_START module, flags_ver
.set push
.section .rodata.sceResident, "a"
.word 0
__stub_modulestr_\module:
.asciz "\module"
.align 2
.section .lib.stub, "a", @progbits
.global __stub_module_\module
__stub_module_\module:
.word __stub_modulestr_\module
.word \flags_ver
.word 0x5
.word __executable_start
.word __executable_start
.set pop
.endm
.macro IMPORT_FUNC module, funcid, funcname
.set push
.set noreorder
.extern __stub_module_\module
.section .sceStub.text, "ax", @progbits
.globl \funcname
.type \funcname, @function
.ent \funcname, 0
\funcname:
.word __stub_module_\module
.word \funcid
.end \funcname
.size \funcname, .-\funcname
.section .rodata.sceNid, "a"
.word \funcid
.set pop
.endm
.macro IMPORT_FUNC_WITH_ALIAS module, funcid, funcname, alias
.set push
.set noreorder
.extern __stub_module_\module
.section .sceStub.text, "ax", @progbits
.globl \alias
.type \alias, @function
\alias:
.globl \funcname
.type \funcname, @function
.ent \funcname, 0
\funcname:
.word __stub_module_\module
.word \funcid
.end \funcname
.size \funcname, .-\funcname
.section .rodata.sceNid, "a"
.word \funcid
.set pop
.endm
.set noreorder
.text
.global _start
_start:
addiu $sp, -0x10
sw $ra, 0($sp)
sw $s0, 4($sp)
sw $s1, 8($sp)
lw $ra, 0($sp)
lw $s0, 4($sp)
lw $s1, 8($sp)
move $v0, $0
jr $ra
addiu $sp, 0x10
.section .lib.ent,"wa",@progbits
__lib_ent_top:
.word 0
.word 0x80000000
.word 0x00010104
.word __entrytable
.section .lib.ent.btm,"wa",@progbits
__lib_ent_bottom:
.word 0
.section .lib.stub,"wa",@progbits
__lib_stub_top:
.section .lib.stub.btm,"wa",@progbits
__lib_stub_bottom:
.word 0
##############################################################################
.globl module_info
.section .rodata.sceModuleInfo,"a",@progbits
.align 4
.type module_info, @object
.size module_info, 52
module_info:
.half 0
.byte 1
.byte 1
.ascii "Hello World\000"
.space 15
.byte 0
.word _gp
.word __lib_ent_top
.word __lib_ent_bottom
.word __lib_stub_top
.word __lib_stub_bottom
##############################################################################
.section .rodata.sceResident,"a",@progbits
__entrytable:
.word 0xD632ACDB
.word 0xF01D73A7
.word _start
.word module_info
.word 0
IMPORT_START "LoadExecForKernel",0x00010000
IMPORT_FUNC "LoadExecForKernel",0x05572A5F,sceKernelExitGame
###############################################################################
.data
.global g_elf_name
g_elf_name: .word 0
.global g_elf_namesize
g_elf_namesize: .word 0
.global g_sr
g_sr: .word 0
###############################################################################
.bss
here is the output of psp-prxgen
oading main.elf, outputting to main.prx
Magic 464C457F, Class 01, Data 01, Idver 01
Type 0002, Machine 0008, Version 00000001, Entry 08900018
Phoff 00000034, Shoff 000012C0, Flags 10A20001, Ehsize 00000034
Phentsize 0020, Phnum 0001
Shentsize 0028, Shnum 00000011, Shstrndx 000E
Section 0:
Name 00000000, Type 00000000, Flags 00000000, Addr 00000000
Offset 00000000, Size 00000000, Link 00000000, Info 00000000
Addralign 00000000, Entsize 00000000 pData (nil)
Section 1: .reginfo
Name 0000001B, Type 70000006, Flags 00000000, Addr 08900000
Offset 000011FC, Size 00000018, Link 00000000, Info 00000000
Addralign 00000004, Entsize 00000001 pData 0x855936c
Section 2: .text
Name 0000002C, Type 00000001, Flags 00000006, Addr 08900018
Offset 00001018, Size 00000028, Link 00000000, Info 00000000
Addralign 00000004, Entsize 00000000 pData 0x8559188
Section 3: .sceStub.text
Name 00000024, Type 00000001, Flags 00000006, Addr 08900040
Offset 00001040, Size 00000008, Link 00000000, Info 00000000
Addralign 00000004, Entsize 00000000 pData 0x85591b0
Section 4: .lib.ent
Name 00000032, Type 00000001, Flags 00000003, Addr 08900048
Offset 00001048, Size 00000010, Link 00000000, Info 00000000
Addralign 00000004, Entsize 00000000 pData 0x85591b8
Section 5: .lib.ent.btm
Name 0000003B, Type 00000001, Flags 00000003, Addr 08900058
Offset 00001058, Size 00000004, Link 00000000, Info 00000000
Addralign 00000004, Entsize 00000000 pData 0x85591c8
Section 6: .lib.stub
Name 00000048, Type 00000001, Flags 00000003, Addr 0890005C
Offset 0000105C, Size 00000014, Link 00000000, Info 00000000
Addralign 00000004, Entsize 00000000 pData 0x85591cc
Section 7: .lib.stub.btm
Name 00000052, Type 00000001, Flags 00000003, Addr 08900070
Offset 00001070, Size 00000004, Link 00000000, Info 00000000
Addralign 00000004, Entsize 00000000 pData 0x85591e0
Section 8: .rodata.sceModuleInfo
Name 00000060, Type 00000001, Flags 00000002, Addr 08900080
Offset 00001080, Size 00000040, Link 00000000, Info 00000000
Addralign 00000010, Entsize 00000000 pData 0x85591f0
Section 9: .rodata.sceResident
Name 00000076, Type 00000001, Flags 00000002, Addr 089000C0
Offset 000010C0, Size 0000002C, Link 00000000, Info 00000000
Addralign 00000004, Entsize 00000000 pData 0x8559230
Section 10: .rodata.sceNid
Name 0000008A, Type 00000001, Flags 00000002, Addr 089000EC
Offset 000010EC, Size 00000004, Link 00000000, Info 00000000
Addralign 00000004, Entsize 00000000 pData 0x855925c
Section 11: .data
Name 00000099, Type 00000001, Flags 00000003, Addr 089001F0
Offset 000011F0, Size 0000000C, Link 00000000, Info 00000000
Addralign 00000004, Entsize 00000000 pData 0x8559360
Section 12: .sbss
Name 0000009F, Type 00000008, Flags 10000003, Addr 089001FC
Offset 00001214, Size 00000000, Link 00000000, Info 00000000
Addralign 00000001, Entsize 00000000 pData 0x8559384
Section 13: .bss
Name 000000A5, Type 00000008, Flags 00000003, Addr 089001FC
Offset 000011FC, Size 00000000, Link 00000000, Info 00000000
Addralign 00000001, Entsize 00000000 pData 0x855936c
Section 14: .shstrtab
Name 00000011, Type 00000003, Flags 00000000, Addr 00000000
Offset 00001214, Size 000000AA, Link 00000000, Info 00000000
Addralign 00000001, Entsize 00000000 pData 0x8559384
Section 15: .symtab
Name 00000001, Type 00000002, Flags 00000000, Addr 00000000
Offset 00001568, Size 00000260, Link 00000010, Info 00000017
Addralign 00000004, Entsize 00000010 pData 0x85596d8
Section 16: .strtab
Name 00000009, Type 00000003, Flags 00000000, Addr 00000000
Offset 000017C8, Size 00000118, Link 00000000, Info 00000000
Addralign 00000001, Entsize 00000000 pData 0x8559938
ELF Load Base address 08900018
Error, found no relocation sections