> 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)?

Look at the code in load_elf_binary that uses target_mmap to map the loadable 
segments into memory. The page size I'm referring to below is the target page 
size (4k for qemu-arm). target_mmap is more-or-less a wrapper around normal 
mmap that deals with the corner cases and differences in page size when 
host != target. 

There are two issues:
- mmap requires the file offset be a multiple of the page size.  This is 
relatively easy to fix. If the file data is misaligned create an anonymous 
mapping and pread the data.

- The code assumes the VMA of the segments after roundind to a page boundary 
do not overlap. ie. a single memory page will contain data from no more than 
one segment. Fixing this is more complicated and probably involves merging 
the regions used by sections with "overlapping" pages.

Paul


_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to