The bottom 32K of memory are generally reserved for use by the BIOS; for example, traditionally the boot loader is placed at 0x7C00 and the stack grows below that address. It turns out that with some versions of clang, realmode.flat has become big enough that it overlaps the stack used by the multiboot option ROM loader. The result is that a couple instructions are overwritten. Typically one or two tests fail and that's it... Move the code above the forbidden region, in real 90s style. Reported-by: Thomas Huth <thuth@xxxxxxxxxx> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> --- x86/realmode.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/realmode.lds b/x86/realmode.lds index 0ed3063b..e4782a98 100644 --- a/x86/realmode.lds +++ b/x86/realmode.lds @@ -1,6 +1,6 @@ SECTIONS { - . = 16K; + . = 32K; stext = .; .text : { *(.init) *(.text) } . = ALIGN(4K); -- 2.45.1