[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qemu qemu-doc.texi

From: Wolfgang Schildbach
Subject: Re: [Qemu-devel] qemu qemu-doc.texi
Date: Mon, 12 Jun 2006 18:17:20 +0200

Thanks much Paul -- that did the trick! (Well, almost.)

For the benefit of other ADS/RVCT users that try this, here is what I did:

- figured out the file offset of the executable region in the axf file 
(readelf -l foo.axf|grep LOAD).
  For me, the offset appears to always be 0x34, and the executable region 
starts at 0x8000.
- linked the application with armlink --ro-base 0x8034. This will move the 
executable region to a new start which is page-aligned to the actual file 
- finally (this took me a little to figure out), I made sure that the 
executable has execute permissions: chmod u+rx foo.axf.

With these changes, I could execute ARM/RealView Developer Suite generated 
executables directly. This is excellent -- thanks much to all who 
contributed to make this possible!

The one remaining issue is that command line parameters are not properly 
transfered over to the ARM executable. This surprises me a little, since 
this does work for arm-userspace-linux, and the mechanisms loading the 
image appear quite similar.

Where would I (start to) look for the reasons behind this? Is this 
something that needs to be "fixed" on the ARM side (i.e. fix the location 
where the ARM code looks for the environment)?

- Wolfgang

Paul Brook <address@hidden> wrote on 12.06.2006 16:18:34:

> On Monday 12 June 2006 15:09, Wolfgang Schildbach wrote:
> > Hi Paul,
> >
> > Does this mean that qemu-arm should be able to run the binaries that 
> > produced by RVCT? I am trying to run a simple helloworld, compiled and
> > linked with rvct2.2 (armcc -g -o hello hello.c) into a "ELF 32-bit LSB
> > executable, ARM, version 1 (SYSV), statically linked, not stripped" 
> > but qemu-arm fails with an "error loading ./hello".
> Yes it should be able to run RVCT binaries. The problem is that the qemu 

> loader assumes the LMA and file offsets be page aligned (ie. be the same 

> modulo the page size). This is part of the ABI for linux executables so 
> the binary can be mmapped directly into memory. RVCT does not enforce 
> alignment by default.
> > On a related note, how do I go about debugging qemu (namely the part 
> > loads executables)? Since qemu appears as a shared object, this is not 
> > straightforward. When I start gdb on arm-user, set a breakpoint at 
> > and type "run", I get
> Configure with --static.
> Paul

Wolfgang Schildbach, Senior Research Engineer
Coding Technologies GmbH

reply via email to

[Prev in Thread] Current Thread [Next in Thread]