diff -r dad770520906 external/gpl3/binutils/dist/gas/config/tc-m68k.c
--- a/external/gpl3/binutils/dist/gas/config/tc-m68k.c	Sun Nov 24 19:41:18 2024 +0000
+++ b/external/gpl3/binutils/dist/gas/config/tc-m68k.c	Mon Dec 02 00:34:35 2024 +1100
@@ -74,6 +74,7 @@ int flag_want_pic;
 static int flag_short_refs;	/* -l option.  */
 static int flag_long_jumps;	/* -S option.  */
 static int flag_keep_pcrel;	/* --pcrel option.  */
+static bool lcfix = true;
 
 #ifdef REGISTER_PREFIX_OPTIONAL
 int flag_reg_prefix_optional = REGISTER_PREFIX_OPTIONAL;
@@ -4272,8 +4273,25 @@ md_assemble (char *str)
 	}
     }
 
+  bool hasnop = false;
+  char *cp, nop[4] = "nop";
+  toP = NULL;
+next:
   memset (&the_ins, '\0', sizeof (the_ins));
-  m68k_ip (str);
+
+  for (cp = str; *cp && *cp == ' '; cp++)
+    ;
+  if (lcfix == true && (*cp == 'f' || *cp == 'F') && hasnop == false)
+    {
+      m68k_ip (nop);
+      hasnop = true;
+    }
+  else
+    {
+      m68k_ip (str);
+      hasnop = false;
+    }
+
   er = the_ins.error;
   if (!er)
     {
@@ -4349,6 +4367,8 @@ md_assemble (char *str)
 	  if (the_ins.reloc[m].wid == 'B')
 	    fixP->fx_signed = 1;
 	}
+      if (hasnop == true)
+	goto next;
       return;
     }
 
@@ -4447,6 +4467,8 @@ md_assemble (char *str)
 					  the_ins.reloc[m].pic_reloc));
       fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
     }
+  if (hasnop == true)
+    goto next;
 }
 
 /* Comparison function used by qsort to rank the opcode entries by name.  */
@@ -7455,6 +7477,8 @@ md_parse_option (int c, const char *arg)
 	;
       else if (m68k_set_cpu (arg, 0, 1))
 	;
+      else if (startswith (arg, "no-lcfix"))
+	lcfix = false;
       else
 	return 0;
       break;
@@ -7556,6 +7580,7 @@ md_show_usage (FILE *stream)
   fprintf (stream, _("\
 -march=<arch>		set architecture\n\
 -mcpu=<cpu>		set cpu [default %s]\n\
+-mno-lcfix		no compatability with lc040 nop before f-line\n\
 "), default_cpu);
   for (i = 0; m68k_extensions[i].name; i++)
     fprintf (stream, _("\
diff -r dad770520906 sys/arch/m68k/m68k/switch_subr.s
--- a/sys/arch/m68k/m68k/switch_subr.s	Sun Nov 24 19:41:18 2024 +0000
+++ b/sys/arch/m68k/m68k/switch_subr.s	Mon Dec 02 00:34:35 2024 +1100
@@ -80,6 +80,7 @@ GLOBAL(masterpaddr)		| XXXcompatibility 
 ASENTRY_NOPROFILE(cpu_idle)
 	stop	#PSL_LOWIPL
 GLOBAL(_Idle)				/* For sun2/sun3's clock.c ... */
+	nop
 	rts
 
 /*
@@ -207,6 +208,7 @@ 2:
 .Lcpu_switch_nofprest:
 	movl	%d1,%d0			| return outgoing lwp
 	movl	%d0,%a0			| (in a0, too)
+	nop
 	rts
 
 /*
@@ -255,6 +257,7 @@ ENTRY(savectx)
 #endif /* FPCOPROC */
 #endif /* !_M68K_CUSTOM_FPU_CTX */
 	moveq	#0,%d0			| return 0
+	nop
 	rts
 
 #if !defined(M68010)
@@ -286,6 +289,7 @@ ENTRY(m68k_make_fpu_idle_frame)
 	frestore (%sp)
 	fnop
 	addql	#4,%sp
+	nop
 	rts
 #endif
 
@@ -307,6 +311,7 @@ ENTRY(m68881_save)
 	fmovem	%fp0-%fp7,FPF_REGS(%a0)	| save FP general registers
 	fmovem	%fpcr/%fpsr/%fpi,FPF_FPCR(%a0) | save FP control registers
 .Lm68881sdone:
+	nop
 	rts
 #endif
 #if defined(M68060)
@@ -318,6 +323,7 @@ ENTRY(m68881_save)
 	fmovem	%fpsr,FPF_FPSR(%a0)
 	fmovem	%fpi,FPF_FPI(%a0)
 .Lm68060sdone:
+	nop
         rts
 #endif
 
@@ -335,6 +341,7 @@ ENTRY(m68881_restore)
 	fmovem	FPF_REGS(%a0),%fp0-%fp7	| restore FP general registers
 .Lm68881rdone:
 	frestore (%a0)			| restore state
+	nop
 	rts
 #endif
 #if defined(M68060)
@@ -347,6 +354,7 @@ ENTRY(m68881_restore)
 	fmovem	FPF_REGS(%a0),%fp0-%fp7 | restore FP general registers
 .Lm68060fprdone:
 	frestore (%a0)			| restore state
+	nop
 	rts
 #endif
 #endif