From: Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] sim: rl78: move storage out of header
Date: Sat, 9 Jan 2021 10:19:36 -0500 [thread overview]
Message-ID: <20210109151936.9041-1-vapier@gentoo.org> (raw)
This port declares its pc variable in a header and then includes
it 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/cpu.c | 2 ++
sim/rl78/cpu.h | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/sim/rl78/cpu.c b/sim/rl78/cpu.c
index a1b85435001e..a38d6f688aee 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 4629e0b69b05..a21de326731f 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[];
--
2.28.0
next reply other threads:[~2021-01-09 15:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-09 15:19 Mike Frysinger via Gdb-patches [this message]
2021-01-11 11:28 ` Andrew Burgess
2021-01-11 13:25 ` Mike Frysinger via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210109151936.9041-1-vapier@gentoo.org \
--to=gdb-patches@sourceware.org \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox