I can make it go away by moving the .code32 directive to the other side of it, i.e. replacing
/* now go to 32-bit segment */ ljmp $KERNEL_CS, $EXT(_SMP_TRAMP_32_ENTRY_)
.code32
by:
.code32
/* now go to 32-bit segment */ ljmp $KERNEL_CS, $EXT(_SMP_TRAMP_32_ENTRY_)
U shouldn't do that ! The problem is that you're still running in a 16bit segment, but you're about to jump into a 32-bit segment. So this should stay in the .code16 part and the output should look like
.byte 0x67, 0x66, 0xea .long address .word code-segment
Seb.