Skip to contentSkip to conversation

how to run a application compiled for sparc platform using qemu-sparc?

Qemu-devel Dylan 2 participants 2 messages Feb 9, 2012

lore
Share & tools
lore

Dylan

author
#0 lore raw

I want to run a application using qemu-sparc,for example "$qemu-sparc hello",where hello is an application compiled for sparc platform. And the host os and architecture are linux and x86. But it catches an error when loading elf file "hello",the spesific error is as follow:
// in load_elf_image function
target_mmap(abi_ulong start, abi_ulong len, int prot, int flags, int fd,abi_ulong offset)

  {
       ... ... 
       /*offset=ox2bf0*/
       if(offset & ~TARGET_PAGE_MASK) /*the condition is true */
           errno=EINVAL;

}

the results of readelf -l hello are as follow:
program headers:
TYPE offset virtAddr phyAddr FileSiz MemSiz
LOAD 0x054 0x4000 0000 0x4000 0000 0x02bf0 0x02bf0

In additon, what is mean of the opiton "-B offset" for qemu-sparc , should I set a value for it ,for example :

     $qemu-sparc hello -B 0x8048000
#1 lore raw
Quoted 5 lines

the results of readelf -l hello are as follow:
program headers:

     TYPE       offset    virtAddr               phyAddr           FileSiz 
       MemSiz LOAD      0x054    0x4000 0000       0x4000 0000    0x02bf0 
    0x02bf0

Clearly not a linux binary. Those have file offsets and virtual addresses aligned modulo page size so that they can be mmapped directly into the process address space. I'm pretty sure this would fail in the same way on a real sparc-linux system.

Paul