« Previous | Next » 

Revision f3ed1f5d

IDf3ed1f5d476bfc18c4b2e27bf2386f54c98561f1

Added by Peter Maydell almost 13 years ago

linux-user: Handle images where lowest vaddr is not page aligned

Fix a bug in the linux-user ELF loader code where it was not correctly
handling images where the lowest vaddr to be loaded was not page aligned.
The problem was that the code to probe for a suitable guest base address
was changing the 'loaddr' variable (by rounding it to a page boundary),
which meant that the load bias would then be incorrectly calculated
unless loaddr happened to already be page-aligned.

Binaries generated by gcc with the default linker script do start with
a loadable segment at a page-aligned vaddr, so were unaffected. This
bug was noticed with a binary created by the Google Go toolchain for ARM.

We fix the bug by refactoring the "probe for guest base" code out into
its own self-contained function.

Signed-off-by: Peter Maydell <>
Signed-off-by: Riku Voipio <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences