diff -r 8aab37c33924 external/gpl3/binutils/dist/gas/config/tc-m68k.c --- a/external/gpl3/binutils/dist/gas/config/tc-m68k.c Sun Dec 01 20:36:00 2024 +0000 +++ b/external/gpl3/binutils/dist/gas/config/tc-m68k.c Mon Dec 02 19:03:37 2024 +1100 @@ -74,6 +74,7 @@ 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,24 @@ } } + bool hasnop = false; + char nop[4] = "nop"; + toP = NULL; +next: memset (&the_ins, '\0', sizeof (the_ins)); + m68k_ip (str); + + if (lcfix == true && hasnop == false && + (the_ins.opcode[0] & 0xf000) == 0xf000) + { + memset (&the_ins, '\0', sizeof (the_ins)); + m68k_ip (nop); + hasnop = true; + } + else + hasnop = false; + er = the_ins.error; if (!er) { @@ -4349,6 +4366,8 @@ if (the_ins.reloc[m].wid == 'B') fixP->fx_signed = 1; } + if (hasnop == true) + goto next; return; } @@ -4447,6 +4466,8 @@ 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 +7476,8 @@ ; else if (m68k_set_cpu (arg, 0, 1)) ; + else if (startswith (arg, "no-lcfix")) + lcfix = false; else return 0; break; @@ -7556,6 +7579,7 @@ fprintf (stream, _("\ -march= set architecture\n\ -mcpu= 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 8aab37c33924 sys/arch/m68k/m68k/switch_subr.s --- a/sys/arch/m68k/m68k/switch_subr.s Sun Dec 01 20:36:00 2024 +0000 +++ b/sys/arch/m68k/m68k/switch_subr.s Mon Dec 02 19:03:37 2024 +1100 @@ -80,6 +80,7 @@ ASENTRY_NOPROFILE(cpu_idle) stop #PSL_LOWIPL GLOBAL(_Idle) /* For sun2/sun3's clock.c ... */ + nop rts /* @@ -207,6 +208,7 @@ .Lcpu_switch_nofprest: movl %d1,%d0 | return outgoing lwp movl %d0,%a0 | (in a0, too) + nop rts /* @@ -255,6 +257,7 @@ #endif /* FPCOPROC */ #endif /* !_M68K_CUSTOM_FPU_CTX */ moveq #0,%d0 | return 0 + nop rts #if !defined(M68010) @@ -286,6 +289,7 @@ frestore (%sp) fnop addql #4,%sp + nop rts #endif @@ -307,6 +311,7 @@ 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 @@ fmovem %fpsr,FPF_FPSR(%a0) fmovem %fpi,FPF_FPI(%a0) .Lm68060sdone: + nop rts #endif @@ -335,6 +341,7 @@ 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 @@ fmovem FPF_REGS(%a0),%fp0-%fp7 | restore FP general registers .Lm68060fprdone: frestore (%a0) | restore state + nop rts #endif #endif