mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 09:38:57 +00:00
sim: namespace sim_machs
We want to do a single build with all arches in one binary which means we need to namespace sim_machs on a per-arch basis. Move it from a global variable to the sim description structure so it can be setup at runtime. Changing the SIM_MODEL->num from an enum to an int is unfortunate, but we specifically don't want to maintain a centralized list anymore, and this was never used directly in common code, just passed to per-arch callbacks.
This commit is contained in:
@@ -150,6 +150,8 @@ or1k_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt, char *arg,
|
||||
return SIM_RC_FAIL;
|
||||
}
|
||||
|
||||
extern const SIM_MACH * const or1k_sim_machs[];
|
||||
|
||||
/* Create an instance of the simulator. */
|
||||
|
||||
SIM_DESC
|
||||
@@ -161,6 +163,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
|
||||
int i;
|
||||
|
||||
/* Set default options before parsing user options. */
|
||||
STATE_MACHS (sd) = or1k_sim_machs;
|
||||
current_target_byte_order = BFD_ENDIAN_BIG;
|
||||
|
||||
/* The cpu data is kept in a separately allocated chunk of memory. */
|
||||
|
||||
Reference in New Issue
Block a user