[PATCH 1/9] Fix undefined symbol errors on readw/writew: arch/io.h, not sys/io.h.

Jamey Sharp jamey at thetovacompany.com
Tue Apr 22 19:21:04 EDT 2008

The undefined symbols naturally weren't relocated by kexec's linker, so
each compiled `call` instruction branched into the middle of itself. The
CPU proceeded to interpret the un-relocated address as instructions,
resulting in an undefined opcode fault. Since at this point no IDT is
loaded, that turned into a triple-fault and reboot.

The bug was only visible when running kexec with --console-vga.

Signed-off-by: Jamey Sharp <jamey at thetovacompany.com>
Although GCC warned about this problem, it would have been easier to
diagnose if the ELF linking code in the kexec userspace tools would
report an error on attempting to link undefined symbols.

 purgatory/arch/i386/console-x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/purgatory/arch/i386/console-x86.c b/purgatory/arch/i386/console-x86.c
index 68f5daf..9773573 100644
--- a/purgatory/arch/i386/console-x86.c
+++ b/purgatory/arch/i386/console-x86.c
@@ -1,5 +1,5 @@
 #include <stdint.h>
-#include <sys/io.h>
+#include <arch/io.h>
 #include <purgatory.h>

More information about the kexec mailing list