qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] hw/core/loader: do not check for regions overla


From: Hua Yanghao
Subject: Re: [Qemu-devel] [PATCH] hw/core/loader: do not check for regions overlap
Date: Mon, 24 Jul 2017 00:11:07 +0200

> Suppose we have these two segments:
>  SEGMENT 1: start 0x1000, end 0x2fff, data all 0xff
>  SEGMENT 2: start 0x2000, end 0x3fff, data all 0x00
>
> Clearly for the memory 0x1000..0x1fff we want the 0xff
> data, and for 0x3000..0x3fff we want 0x00.
> But for the memory 0x2000..0x2fff which is in
> both segment 1 and segment 2, should QEMU load
> 0xff or 0x00 bytes ?
>
> We shouldn't pick randomly or just do whatever our
> implementation "happens to do" -- we need to look
> at what the ELF spec says must happen and do that.
I don't see how linker could allow that to happen.
If two section overlaps one of them should be of NOLOAD type.
Otherwise linker complains the overlapping of LMA.

So for me just ignore NOLOAD section would do the trick.

> The patch you have here will affect QEMU's handling
> of ROMs of all types, because the loader.c code
> handles all the registered ROM images, not just those
> that the ELF loader creates from ELF files.
>
> (PS: these questions are partly aimed at the other
> QEMU developers who I cc'd, not just you.)
>
Thanks PPM. This is really beyond my knowledge and hope someone could
help making a clean patch!

BR, Yanghao



reply via email to

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