mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
linux-user: Pass last not end to probe_guest_base
Pass the address of the last byte of the image, rather than the first address past the last byte. This avoids overflow when the last page of the address space is involved. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
e506ad6a05
commit
a3a67f54f0
3 changed files with 19 additions and 19 deletions
|
@ -76,19 +76,19 @@ void fork_end(int child);
|
|||
/**
|
||||
* probe_guest_base:
|
||||
* @image_name: the executable being loaded
|
||||
* @loaddr: the lowest fixed address in the executable
|
||||
* @hiaddr: the highest fixed address in the executable
|
||||
* @loaddr: the lowest fixed address within the executable
|
||||
* @hiaddr: the highest fixed address within the executable
|
||||
*
|
||||
* Creates the initial guest address space in the host memory space.
|
||||
*
|
||||
* If @loaddr == 0, then no address in the executable is fixed,
|
||||
* i.e. it is fully relocatable. In that case @hiaddr is the size
|
||||
* of the executable.
|
||||
* If @loaddr == 0, then no address in the executable is fixed, i.e.
|
||||
* it is fully relocatable. In that case @hiaddr is the size of the
|
||||
* executable minus one.
|
||||
*
|
||||
* This function will not return if a valid value for guest_base
|
||||
* cannot be chosen. On return, the executable loader can expect
|
||||
*
|
||||
* target_mmap(loaddr, hiaddr - loaddr, ...)
|
||||
* target_mmap(loaddr, hiaddr - loaddr + 1, ...)
|
||||
*
|
||||
* to succeed.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue