public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] sim: move bfd.h include out of sim-main.h
@ 2022-12-23  3:37 Mike Frysinger
  2022-12-23  3:37 ` [PATCH 2/2] sim: endian: move bfd.h from header to source Mike Frysinger
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2022-12-23  3:37 UTC (permalink / raw)
  To: gdb-patches

Not all arches include this in sim-main.h, and the ones that do don't
actually use bfd defines in the sim-main.h header.  Prune it to make
sim-main.h simpler so we can kill it off entirely in the future.

We add the include to the files that utilize e.g. bfd_vma though.
---
 sim/arm/sim-main.h       | 1 -
 sim/common/cgen-trace.h  | 1 +
 sim/common/sim-base.h    | 2 ++
 sim/common/sim-trace.h   | 1 +
 sim/cr16/sim-main.h      | 1 -
 sim/cr16/simops.c        | 2 ++
 sim/d10v/sim-main.h      | 1 -
 sim/d10v/simops.c        | 2 ++
 sim/frv/sim-main.h       | 1 +
 sim/ft32/sim-main.h      | 1 -
 sim/h8300/sim-main.h     | 2 --
 sim/m68hc11/interp.c     | 2 ++
 sim/m68hc11/interrupts.c | 2 ++
 sim/m68hc11/sim-main.h   | 2 --
 sim/mcore/sim-main.h     | 1 -
 sim/mips/sim-main.h      | 1 -
 sim/moxie/sim-main.h     | 1 -
 sim/riscv/interp.c       | 2 ++
 sim/rx/gdb-if.c          | 1 +
 sim/v850/sim-main.h      | 2 --
 20 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/sim/arm/sim-main.h b/sim/arm/sim-main.h
index bdc5019a3033..5ca01eb91c5f 100644
--- a/sim/arm/sim-main.h
+++ b/sim/arm/sim-main.h
@@ -21,7 +21,6 @@
 
 #include "sim-basics.h"
 #include "sim-base.h"
-#include "bfd.h"
 
 #undef BIT
 #include "armdefs.h"
diff --git a/sim/common/cgen-trace.h b/sim/common/cgen-trace.h
index 3e2b4a9e9d7e..f2368578d5ea 100644
--- a/sim/common/cgen-trace.h
+++ b/sim/common/cgen-trace.h
@@ -21,6 +21,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #define CGEN_TRACE_H
 
 #include "ansidecl.h"
+#include "bfd.h"
 
 void cgen_trace_insn_init (SIM_CPU *, int);
 void cgen_trace_insn_fini (SIM_CPU *, const struct argbuf *, int);
diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h
index 796666d11d5e..46bf9050ca56 100644
--- a/sim/common/sim-base.h
+++ b/sim/common/sim-base.h
@@ -73,6 +73,8 @@ typedef address_word sim_cia;
 typedef struct _sim_cpu SIM_CPU;
 typedef struct _sim_cpu sim_cpu;
 
+#include "bfd.h"
+
 #include "sim-module.h"
 
 #include "sim-arange.h"
diff --git a/sim/common/sim-trace.h b/sim/common/sim-trace.h
index 8d4ab1308153..d7cba2df4d4c 100644
--- a/sim/common/sim-trace.h
+++ b/sim/common/sim-trace.h
@@ -25,6 +25,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <stdarg.h>
 
 #include "ansidecl.h"
+#include "bfd.h"
 #include "dis-asm.h"
 
 /* Standard traceable entities.  */
diff --git a/sim/cr16/sim-main.h b/sim/cr16/sim-main.h
index 188c32caa09c..a54a36559814 100644
--- a/sim/cr16/sim-main.h
+++ b/sim/cr16/sim-main.h
@@ -21,7 +21,6 @@
 
 #include "sim-basics.h"
 #include "sim-base.h"
-#include "bfd.h"
 
 #include "cr16_sim.h"
 
diff --git a/sim/cr16/simops.c b/sim/cr16/simops.c
index d58c0c933953..6eefe1bff60f 100644
--- a/sim/cr16/simops.c
+++ b/sim/cr16/simops.c
@@ -31,6 +31,8 @@
 #include <time.h>
 #include <sys/time.h>
 
+#include "bfd.h"
+
 #include "sim-main.h"
 #include "sim-signal.h"
 #include "simops.h"
diff --git a/sim/d10v/sim-main.h b/sim/d10v/sim-main.h
index a6462d8c6a43..4e6771af70fc 100644
--- a/sim/d10v/sim-main.h
+++ b/sim/d10v/sim-main.h
@@ -21,7 +21,6 @@
 
 #include "sim-basics.h"
 #include "sim-base.h"
-#include "bfd.h"
 
 #include "d10v_sim.h"
 
diff --git a/sim/d10v/simops.c b/sim/d10v/simops.c
index 9883b3f55281..a2eb3677e7e2 100644
--- a/sim/d10v/simops.c
+++ b/sim/d10v/simops.c
@@ -10,6 +10,8 @@
 #endif
 #include <string.h>
 
+#include "bfd.h"
+
 #include "sim-main.h"
 #include "sim-signal.h"
 #include "simops.h"
diff --git a/sim/frv/sim-main.h b/sim/frv/sim-main.h
index 5fbf94d1f613..2ad757180021 100644
--- a/sim/frv/sim-main.h
+++ b/sim/frv/sim-main.h
@@ -31,6 +31,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-basics.h"
 #include "cgen-types.h"
 #include "frv-desc.h"
+#include <stdbool.h>
 #include "frv-opc.h"
 #include "arch.h"
 
diff --git a/sim/ft32/sim-main.h b/sim/ft32/sim-main.h
index e160a12880dd..5c84f9e2f219 100644
--- a/sim/ft32/sim-main.h
+++ b/sim/ft32/sim-main.h
@@ -23,7 +23,6 @@
 
 #include "sim-basics.h"
 #include "sim-base.h"
-#include "bfd.h"
 
 #include "ft32-sim.h"
 
diff --git a/sim/h8300/sim-main.h b/sim/h8300/sim-main.h
index 84bb346a9a95..c034699e5c55 100644
--- a/sim/h8300/sim-main.h
+++ b/sim/h8300/sim-main.h
@@ -1,7 +1,5 @@
 /* Main header for the Hitachi h8/300 architecture.  */
 
-#include "bfd.h"
-
 #ifndef SIM_MAIN_H
 #define SIM_MAIN_H
 
diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c
index 2620060dca1d..89c6449dfe1a 100644
--- a/sim/m68hc11/interp.c
+++ b/sim/m68hc11/interp.c
@@ -20,6 +20,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include "bfd.h"
+
 #include "sim-main.h"
 #include "sim-assert.h"
 #include "sim-hw.h"
diff --git a/sim/m68hc11/interrupts.c b/sim/m68hc11/interrupts.c
index ee65f4375af1..5b3d48faa9b4 100644
--- a/sim/m68hc11/interrupts.c
+++ b/sim/m68hc11/interrupts.c
@@ -20,6 +20,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include "bfd.h"
+
 #include "sim-main.h"
 #include "sim-options.h"
 #include "sim-signal.h"
diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h
index e47bd83f9b9a..f320bf10b08c 100644
--- a/sim/m68hc11/sim-main.h
+++ b/sim/m68hc11/sim-main.h
@@ -23,8 +23,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-basics.h"
 #include "sim-base.h"
 
-#include "bfd.h"
-
 #include "opcode/m68hc11.h"
 
 #include "sim/sim.h"
diff --git a/sim/mcore/sim-main.h b/sim/mcore/sim-main.h
index 7290e02131ec..684ec39354be 100644
--- a/sim/mcore/sim-main.h
+++ b/sim/mcore/sim-main.h
@@ -21,7 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-basics.h"
 #include "sim-base.h"
-#include "bfd.h"
 
 /* The machine state.
    This state is maintained in host byte order.  The
diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h
index 9ec6c121b3aa..696a1bcf81bd 100644
--- a/sim/mips/sim-main.h
+++ b/sim/mips/sim-main.h
@@ -25,7 +25,6 @@ mips_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ER
 
 #include "sim-basics.h"
 #include "sim-base.h"
-#include "bfd.h"
 #include "elf-bfd.h"
 #include "elf/mips.h"
 
diff --git a/sim/moxie/sim-main.h b/sim/moxie/sim-main.h
index c4be80e39d26..d0df1e927cd1 100644
--- a/sim/moxie/sim-main.h
+++ b/sim/moxie/sim-main.h
@@ -22,7 +22,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-basics.h"
 #include "sim-base.h"
-#include "bfd.h"
 
 #define PCIDX 17
 
diff --git a/sim/riscv/interp.c b/sim/riscv/interp.c
index 50b5a514e327..6bd0bf2a41a6 100644
--- a/sim/riscv/interp.c
+++ b/sim/riscv/interp.c
@@ -21,6 +21,8 @@
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include "bfd.h"
+
 #include "sim/callback.h"
 #include "sim-main.h"
 #include "sim-options.h"
diff --git a/sim/rx/gdb-if.c b/sim/rx/gdb-if.c
index caa7ddbcb325..edc99e6e77d0 100644
--- a/sim/rx/gdb-if.c
+++ b/sim/rx/gdb-if.c
@@ -29,6 +29,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <stdlib.h>
 
 #include "ansidecl.h"
+#include "bfd.h"
 #include "libiberty.h"
 #include "sim/callback.h"
 #include "sim/sim.h"
diff --git a/sim/v850/sim-main.h b/sim/v850/sim-main.h
index abf2ed78febc..9d56469d6665 100644
--- a/sim/v850/sim-main.h
+++ b/sim/v850/sim-main.h
@@ -11,8 +11,6 @@
 #include "sim-base.h"
 
 #include "simops.h"
-#include "bfd.h"
-
 
 typedef uint32_t reg_t;
 typedef uint64_t reg64_t;
-- 
2.39.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] sim: endian: move bfd.h from header to source
  2022-12-23  3:37 [PATCH 1/2] sim: move bfd.h include out of sim-main.h Mike Frysinger
@ 2022-12-23  3:37 ` Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2022-12-23  3:37 UTC (permalink / raw)
  To: gdb-patches

The bfd APIs are used only by sim-n-endian.h which is only included by
sim-endian.c, so move the bfd.h include there and out of sim-endian.h
which is included by many other modules.
---
 sim/common/sim-endian.c | 2 ++
 sim/common/sim-endian.h | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sim/common/sim-endian.c b/sim/common/sim-endian.c
index 647795b37e4e..92c661829165 100644
--- a/sim/common/sim-endian.c
+++ b/sim/common/sim-endian.c
@@ -26,6 +26,8 @@
 /* This must come before any other includes.  */
 #include "defs.h"
 
+#include "bfd.h"
+
 #include "sim-basics.h"
 #include "sim-assert.h"
 
diff --git a/sim/common/sim-endian.h b/sim/common/sim-endian.h
index 9d46db2b18f7..b6d97f5c1440 100644
--- a/sim/common/sim-endian.h
+++ b/sim/common/sim-endian.h
@@ -23,8 +23,6 @@
 #ifndef SIM_ENDIAN_H
 #define SIM_ENDIAN_H
 
-#include "bfd.h"
-
 /* C byte conversion functions */
 
 INLINE_SIM_ENDIAN(unsigned_1) endian_h2t_1(unsigned_1 x);
-- 
2.39.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-23  3:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-23  3:37 [PATCH 1/2] sim: move bfd.h include out of sim-main.h Mike Frysinger
2022-12-23  3:37 ` [PATCH 2/2] sim: endian: move bfd.h from header to source Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).