[PATCH] Fix build error in gas/config/tc-sh.c

Magnus Damm magnus.damm@gmail.com
Fri Nov 20 15:37:02 GMT 2026


This summer I tried to build binutils for my old sh7751-based R2D-plus,
however binutils-2.47 with target sh4-unknown-elf seems to fail building.

Anyone wanting a simple test case for binutils may check out the teeensy
repo at github and the R2D-plus implementation to turn on the LED:
https://github.com/papadamm/teeensy/blob/main/teeensy-r2dplus-sh7751r.sh

Signed-off-by: Magnus Damm <magnus.damm@gmail.com>

 gas/config/tc-sh.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -urN binutils-2.47/gas/config/tc-sh.c binutils-2.47-sh4-fix/gas/config/tc-sh.c
--- binutils-2.47/gas/config/tc-sh.c	2026-07-26 01:00:00.000000000 +0200
+++ binutils-2.47-sh4-fix/gas/config/tc-sh.c	2026-08-19 09:17:59.433090996 +0200
@@ -2547,7 +2547,7 @@
          bytes are instructions, not data.  */
       fix_new (frag_now, frag_now_fix (), 2, &abs_symbol, 0, 0,
 	       BFD_RELOC_SH_CODE);
-      seg_info (now_seg)->tc_segment_info_data.in_code = 1;
+      seg_info (now_seg)->tc_segment_info_data.in_code = true;
     }
 
   if (opcode->nibbles[0] == PPI)


More information about the Binutils mailing list