On Tue, Apr 26, 2022, Varad Gautam wrote: > diff --git a/x86/start32.S b/x86/start32.S > index 9e00474..2089be7 100644 > --- a/x86/start32.S > +++ b/x86/start32.S > @@ -27,7 +27,16 @@ MSR_GS_BASE = 0xc0000101 > .endm > > prepare_64: > - lgdt gdt_descr > +#ifdef CONFIG_EFI > + call prepare_64_1 > +prepare_64_1: Use "1:" for the label, and 1f / 1b, that way it's obvious it's a relatively transient thing. > + pop %edx > + add $gdt_descr - prepare_64_1, %edx > +#else > + mov $gdt_descr, %edx > +#endif Rather than have #ifdefs everyway, add a macro to hide the differences, e.g. load_absolute_addr.