Skip to contentSkip to conversation

Porting QEMU to PalmOS

Qemu-devel sinisa marovic 2 participants 2 messages May 23, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I started porting QEMU to PalmOS. I already ported some projects successfuly (Like UAE and
dosbox) but dosbox is so slow. QEMU has less compatibility with games but it is much faster. Now, I am having some problems with dyngen. Since QEMU supports ARM hosts I do not have to modify the code. Detailed description of the problem follows:

Dyngen is used to create op.h, opc.h and gen-op.h during compilation. Since it is not possible to do the actual compilation on Palm itself, I thought of creating dyngen executable on the compilation host (PC with cygwin) and QEMU would then be built for execution host (Palm). This idea worked fine, but when dyngen was executed to create op.h I got an error:

"Unsupported data relocation."

I did some debugging to find out what the actual problem is, and this is what I found out:

Relocation types that fail are 25 and 26, which are R_ARM_GOTPC and R_ARM_GOT32 respectively. Their names are:

_GLOBAL_OFFSET_TABLE_
cc_table
__op_param1
__op_param2
__op_param3

Is there a way to fix this?

Regards,
Voda.

____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/

#1 lore raw

Hi,

Quoted 10 lines · sinisa marovic

Relocation types that fail are 25 and 26, which are R_ARM_GOTPC and R_ARM_GOT32 respectively. Their names are:

_GLOBAL_OFFSET_TABLE_
cc_table
__op_param1
__op_param2
__op_param3

Is there a way to fix this?

The GOT is an offset table. Many CPUs have fixed-size instruction sets, which means that you cannot easily jump to an absolute address, since the address alone would already fill up the size.

Of course, this is a no-no for QEmu, since the _same_ function snippet will be reused _multiple_ times. So, the address must not come from a GOT, but be inserted directly into the code.

I do not remember off-hand how I managed to do this a couple of years ago, when I worked on a MIPS host, but there _are_ gcc options to avoid a GOT.

Hth,
Dscho