sim: rl78: move storage out of header
authorMike Frysinger <vapier@gentoo.org>
Sat, 9 Jan 2021 15:18:50 +0000 (10:18 -0500)
committerMike Frysinger <vapier@gentoo.org>
Mon, 11 Jan 2021 13:25:34 +0000 (08:25 -0500)
This port declares its pc variable in a header and then includes
it multiple times.  This causes linker errors with newer gcc due
to the change in -fno-common behavior.  Move the storage to a C
file so we only have one instance of it in the final program.

sim/rl78/ChangeLog
sim/rl78/cpu.c
sim/rl78/cpu.h

index 8944ad42255fa47f4d41de4e81c4856cc99a7403..ec3161471d2682140e43031fee339ae44b3cc12e 100644 (file)
@@ -1,3 +1,8 @@
+2021-01-11  Mike Frysinger  <vapier@gentoo.org>
+
+       * cpu.h (pc): Change to an extern.
+       * cpu.c (pc): Define.
+
 2021-01-11  Mike Frysinger  <vapier@gentoo.org>
 
        * config.in, configure: Regenerate.
index a1b85435001ef7e756249c67f7e7184af0be89a9..a38d6f688aee7ba314cddb43c9edf24ce7c54473 100644 (file)
@@ -36,6 +36,8 @@ int rl78_g10_mode = 0;
 int g13_multiply = 0;
 int g14_multiply = 0;
 
+SI pc;
+
 #define REGISTER_ADDRESS 0xffee0
 
 typedef struct {
index 4629e0b69b05829699e0031bbb881dca1e19a41f..a21de326731f4bad0a00a42656fc0d3b805c3db8 100644 (file)
@@ -39,7 +39,7 @@ extern int rl78_in_gdb;
 SI get_reg (RL78_Register);
 SI set_reg (RL78_Register, SI);
 
-SI pc;
+extern SI pc;
 
 
 extern const char * const reg_names[];
This page took 0.027215 seconds and 4 git commands to generate.