forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fixup Imports error (I only have ONE lib!!)

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Fri Oct 31, 2008 2:42 pm    Post subject: Fixup Imports error (I only have ONE lib!!) Reply with quote

I tried using this stub made by booster for this function:

Code:
.set noreorder

#include "pspimport.s"

IMPORT_START   "sceSyscon_driver",0x00010000
IMPORT_FUNC   "sceSyscon_driver",0x5EE92F3C,sceSysconSetDebugHandlers


Its named import.s and I've added to the makefile as import.o

I have only one LIBS in my app lpsppower_driver.

It just says cannot fixup imports and that I have to put the PSPSDK libs last. If I remove the lpsppower_driver and its functions, then it compiles. I can't change the order because there is only one lib!!

So I had to remove the stub and I used sctrlHENFindFunction to get the function address and assign it to my pointer prototype. Then it compiles.

This is the makefile in question.

Code:
TARGET = hold
OBJS = main.o import.o sysconhk.o exports.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

BUILD_PRX = 1
PRX_EXPORTS = exports.exp

USE_KERNEL_LIBC=1
USE_KERNEL_LIBS=1

PSP_FW_VERSION = 390

LIBDIR =
LIBS = -lpsppower_driver
LDFLAGS = -nostdlib -nodefaultlibs

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak
Back to top
View user's profile Send private message
SilverSpring



Joined: 27 Feb 2007
Posts: 115

PostPosted: Fri Oct 31, 2008 2:52 pm    Post subject: Reply with quote

Post the actual error output.

Anyway, the stub looks incomplete, try this instead:

Code:

   .set noreorder

#include "pspstub.s"

   STUB_START   "sceSyscon_driver",0x00010011,0x00010005
   STUB_FUNC   0x5EE92F3C,sceSysconSetDebugHandlers



Or grab full stubs from http://silverspring.lan.st/ either the 1.50 ones or the 3.52 ones, they are usually the most up-to-date. I've tested those stubs they work for sure. Just add sceSyscon_driver.o to yours OBJS.

EDIT:
Just noticed that what you posted was an imports file and not a stubs file. Glad you got it working anyway.
_________________
PSP PRX LibDocs


Last edited by SilverSpring on Fri Oct 31, 2008 4:04 pm; edited 5 times in total
Back to top
View user's profile Send private message Visit poster's website
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Fri Oct 31, 2008 3:44 pm    Post subject: Reply with quote

The 3.52 stub file works, thanks.
Back to top
View user's profile Send private message
SilverSpring



Joined: 27 Feb 2007
Posts: 115

PostPosted: Fri Oct 31, 2008 3:57 pm    Post subject: Reply with quote

*nvm wrong button*
_________________
PSP PRX LibDocs
Back to top
View user's profile Send private message Visit poster's website
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Fri Oct 31, 2008 4:04 pm    Post subject: Reply with quote

If I use the entire stub list, it bloats my kernel prx by a few kb. I edited out everything except for the function I used. Shouldn't the linker be smart enough to do this automatically?
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Fri Oct 31, 2008 4:08 pm    Post subject: Reply with quote

NVM, the edited stub list bricked my psp...

Isn't there anyway to make it smaller because I just want to import one function? The PRX is the smallest if I dynamically find the function at runtime without compiling with any imports.
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Fri Oct 31, 2008 4:17 pm    Post subject: Reply with quote

The stub you gave has 0x00010005
STUB_START "sceSyscon_driver",0x00010011,0x00010005

while the sceSyscon_driver.S entire stub list has 0x008B0005
STUB_START "sceSyscon_driver",0x00010011,0x008B0005

What is the meaning of that last parameter?

*NVM* I managed to figure out its the number of stubs declared. 8b=139 stubs.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group