View Single Post
Old 17 September 2019, 15:06   #9
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Hedeon View Post
Well, I checked the linked result (.library) with IRA and that is where the question came from. I use -sc but I see 32 bit reloc jumps in the code.
Hmmm... yes. The reason is in the linker libraries, not in your code. Even if you compile with -sc and -sd and link with -lvcs, the vcs.lib itself was only compiled with -sd, but not with -sc. So all calls from the vcs.lib are absolute.

I wonder if I should change that for the upcoming release. When you link with a small-data library, does it make sense to always have small-code as well? Probably.

Quote:
It is a rewrite of my powerpc.library from asm to C for educational purposes (to start with and later for ease of maintenance).
You seem to have too much time!

Quote:
What happens is that AUTOINIT is off and the libinit function sets up the tables etc (initresident/makelibrary etc). The 68K functions remain in FAST RAM, the PPC functions need to be in a different kind of RAM (attr $2005) where also the library base will be. This memory s not available yet at the init of the library.
Ok. The PowerOpen-ABI code should be more or less PC-relative anyway. As I understand you only have to allocate the library base structure in $2005-RAM and put everything in it. Doesn't that work?

Quote:
Regarding the answer from bebbo, it looked a lot of manual work. I thought maybe it was supposed to be easier, my bad. Can it be done in C as your example is in asm?
Sure. Just start your first init-function with the __saveds attribute. The code generator will emit code for setting up A4 in the function header.

Quote:
You're last point is a good one. I should utilize the library base better.
Yes. See above. Perhaps you don't even need to set up small data for m68k.
phx is offline  
 
Page generated in 0.15982 seconds with 11 queries