From: Mike Frysinger Date: Sat, 9 Jan 2021 15:18:50 +0000 (-0500) Subject: sim: rl78: move storage out of header X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=933306703a73585ad80c72a8a9422833074961a2;p=binutils-gdb.git sim: rl78: move storage out of header 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. --- diff --git a/sim/rl78/ChangeLog b/sim/rl78/ChangeLog index 8944ad42255..ec3161471d2 100644 --- a/sim/rl78/ChangeLog +++ b/sim/rl78/ChangeLog @@ -1,3 +1,8 @@ +2021-01-11 Mike Frysinger + + * cpu.h (pc): Change to an extern. + * cpu.c (pc): Define. + 2021-01-11 Mike Frysinger * config.in, configure: Regenerate. diff --git a/sim/rl78/cpu.c b/sim/rl78/cpu.c index a1b85435001..a38d6f688ae 100644 --- a/sim/rl78/cpu.c +++ b/sim/rl78/cpu.c @@ -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 { diff --git a/sim/rl78/cpu.h b/sim/rl78/cpu.h index 4629e0b69b0..a21de326731 100644 --- a/sim/rl78/cpu.h +++ b/sim/rl78/cpu.h @@ -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[];