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

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

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

Post by Torch »

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

Code: Select all

.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: Select all

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
SilverSpring
Posts: 110
Joined: Tue Feb 27, 2007 9:43 pm
Contact:

Post by SilverSpring »

Post the actual error output.

Anyway, the stub looks incomplete, try this instead:

Code: Select all

	.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.
Last edited by SilverSpring on Fri Oct 31, 2008 4:04 pm, edited 5 times in total.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

The 3.52 stub file works, thanks.
SilverSpring
Posts: 110
Joined: Tue Feb 27, 2007 9:43 pm
Contact:

Post by SilverSpring »

*nvm wrong button*
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

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?
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

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.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

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.
Post Reply