On 06/12/2012 09:08 AM, Richard Henderson wrote:

> On 2012-06-07 13:59, Meador Inge wrote:
>>      load_addr = loaddr;
>>      if (ehdr->e_type == ET_DYN) {
>> +        if (loaddr < mmap_min_addr)
>> +            probe_guest_base(image_name, loaddr, hiaddr);
> 
> This doesn't make any sense.  loaddr is almost certainly 0, unless
> you've pre-linked the ld.so image.  But the next statement is letting
> the system pick the address at which the image will be loaded.

It usually is.  I just want guest_base to be computed to something that
will work for cases where a fixed address image is later loaded (at which
point it is too late to compute the guest_base).  Always probing is one way I
found to do that, but as I originally said I don't know this code very well so
maybe that is not a good method.

> I think this is one of those cases where the -B or -R options
> (or QEMU_GUEST_BASE and QEMU_RESERVED_VA env variables) are the best
> way forward for whatever cpu you're emulating.  That or a change to
> the target's default ld script, not to link real executables quite so 
> low in the address space.

Hmmm, OK.  I was really hoping to have something more automatic.  Perhaps
I will have to use the options.

Thanks for the review.

-- 
Meador Inge
CodeSourcery / Mentor Embedded
http://www.mentor.com/embedded-software

Reply via email to