[kaffe] Re: kaffe for m68k/linux and m68k/netbsd
inaba at src.ricoh.co.jp
Wed May 19 10:38:02 PDT 2004
OK, at least jit properly calls 'soft_fixup_trampoline'...
# But just after that, it crashed again ;-<
>> Could this be cause of my grief on OpenBSD/68k too? should I try to
>> import this chaneg in the OpenBSD m68k header (which, for testing
>> purposes, is still separate and I imported may changes in the updated,
>> common m68k/jit.h
>If your gcc on m68k-openbsd pads fixup, then yes.
The 'trampoline' code which is used to invoke just in time compilation
is, first prepared by buildTrampoline (in classMethod.c) and the real
code segment is prepared by callMethodA or callMethodV in support.c.
The first call is for clinit of String class, and callMethodA is called.
So, if you want to check whether padding is added or not by (in gdb)
(gdb) b support.c:605 # just before sysdepCallMethod
(gdb) r <your program>
(gdb) x/i call.function # this points to trampoline
# if the output is proper jsr routine, it is ok
Before modifying the structure gdb prints something like 'jsr 0x5',
and on m68k architecture there should be no subroutine at all at 0x5!
After the modification, it says 'jsr 0x523b0' (in my case) and the
address is start of 'm68k_do_fixup_trampoline' function. That is the
way how I notice extra two bytes are inserted between 'jsr' opcode
itself and its argument. I mean the funny (on m68k, any small address
can be thought as 'funny') address 0x5 comes from upper two bytes
This description should be too architecture specific, and may not
have wide interests.
More information about the kaffe