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 

newlib, _close() and $gp enabled...

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



Joined: 30 Aug 2005
Posts: 1

PostPosted: Wed Sep 14, 2005 3:07 am    Post subject: newlib, _close() and $gp enabled... Reply with quote

Hi there all,

My first post here and have a couple of questions. I've done programming for the PSP the past couple of weeks (ported Stella and Atari800) but since last week, after I updated the toolchain, I got some strange errors. Mostly in stdio calls. So I decided to track it down, this is what I found:

1) on line 622 of the newlib patch it says:
Code:
+      sce_fd == sceKernelStderr();

and I think that should have been an assignment as in the lines above it.
2) why was the following code added in libc/include/sys/config.h? I noticed that on small applications it's not a problem, but on some large ones the ptr of the global reent structure wasn't correctly initialised, maybe a linker bug (or __psp__ is not set correctly?)?:
Code:
/* We compile newlib with -G0 for PSP, but if we're compiling an app with $gp enabled,
   then _impure_ptr is expected to live in .sdata. */
#if defined(__psp__)
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
#endif


After searching the net I found out that the $gp register can be used as a global pointer to (small) data. So I'm wondering what means $gp enabled? How do you enable it? (or do you enable it with -G8 for example?) Why could it be usefull?

After commenting it out and recompiling everything the projects started working again. Did I find a bug or am I doing something wrong?

Aenea
Back to top
View user's profile Send private message MSN Messenger
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