/* Initialize interrupt frame and load executable. */
memset (&if_, 0, sizeof if_);
+ if_.gs = SEL_UDSEG;
+ if_.fs = SEL_UDSEG;
if_.es = SEL_UDSEG;
if_.ds = SEL_UDSEG;
if_.cs = SEL_UCSEG;
arguments on the stack in the form of a `struct intr_frame',
we just point the stack pointer (%esp) to our stack frame
and jump to it. */
- asm ("mov %0, %%esp\n"
- "jmp intr_exit\n"
- : /* no outputs */
- : "g" (&if_));
+ asm ("mov %%esp, %0; jmp intr_exit" :: "g" (&if_));
NOT_REACHED ();
}
}
/* p_offset must point within file. */
- if (phdr->p_offset < 0 || phdr->p_offset > file_length (file))
+ if (phdr->p_offset > (Elf32_Off) file_length (file))
{
printf ("bad p_offset %"PE32Ox, phdr->p_offset);
return false;