[fpc-devel] PPC64 port
Peter Vreman
peter at freepascal.org
Mon Apr 18 13:37:31 CEST 2005
> Hello,
>
> I've been working on the PPC64-port for the Linux on Power contest
> for some time now, and finally have some questions I'd like to ask for
> here:
>
> Some introduction: I am trying to use the PPC64-ELF ABI for all
> generated methods, first because of compatibility issues (I believe it's
> needed anyway) and it imo does not really matter which to choose
> initially.
> There are two problems with that though; I didn't fix them yet because
> I'm hesitating to change stuff in the compiler-directory (all ppc64
> specific things are in a subdirectory at the moment), and that's why I'm
> asking:
>
> *) functions are not simple adresses anymore, but references to a so
> called function descriptor (if I remember the name correctly). Problem
> is that the assembly generator seems to hardcode the method
> specification prologue to:
>
> .globl <mangledmethodname>
> .type <mangledmethodname>, @function
> <mangledmethodname>:
> ... method assembly ...
>
> Problem is that this does not seem to work on PPC64 (tried on some
> hand-made assembly code); the GNU linker assumes that
> <mangledmethodname> is a function pointer, mangles it, and the resulting
> programs always crash on calling a method... ;-)
Check the output of 'gcc -S' with a simple example. The code to write the
function prologue/epilogue can be moved to a virtual function and be
overriden for ppc64 if needed.
> I found that in aggas.pas this behaviour seems to be hardcoded. Is there
> another way to change the function specification prologue?
> (Btw, there's a similar problem with the epilogue)
>
> There is a way to specify "local" methods without those function
> pointers, but... this works for local methods only. :(
>
> *) as far as I understand PPC64 ELF ABI assumes that at if there's a
> stack, the area which holds the register contents R3-R10 is always
> available (e.g. the 8x8 bytes for saving register contents). Is there a
> way to specify a minimum size for the stack without changing something
> in the method which calculates stack layout?
> (I thought of something like dummy local variables if needed)
See sparc
> *) How do I add a symbol/constant to the TOC? I'd like to avoid certain
> really time consuming operations on constants...
>
> *) one really minor thing: what should the platform be called? PPC64?
> POWERPC64? POWERPC_64 (like x86_64)? =)
What the Linux kernel returns with 'uname -m'
More information about the fpc-devel
mailing list