diff options
author | Anthony Green <green@redhat.com> | 2010-01-13 08:28:26 +0000 |
---|---|---|
committer | Anthony Green <green@redhat.com> | 2010-01-13 08:28:26 +0000 |
commit | b8dcd18250faa7438fc2c9051849f2ac03264ad9 (patch) | |
tree | f28a44947d3c36444925ca268f27805efbfce46c /sim/moxie/interp.c | |
parent | a120bc7fab8eb04089b29c8117c32051200f5e0e (diff) | |
download | binutils-gdb-b8dcd18250faa7438fc2c9051849f2ac03264ad9.tar.gz |
Initialize SIM_DESC properly.
Diffstat (limited to 'sim/moxie/interp.c')
-rw-r--r-- | sim/moxie/interp.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c index 8b8879f13b3..8d280f2cc47 100644 --- a/sim/moxie/interp.c +++ b/sim/moxie/interp.c @@ -1176,6 +1176,22 @@ sim_open (kind, cb, abfd, argv) set_initial_gprs (); /* Reset the GPR registers. */ + /* Configure/verify the target byte order and other runtime + configuration options */ + if (sim_config (sd) != SIM_RC_OK) + { + sim_module_uninstall (sd); + return 0; + } + + if (sim_post_argv_init (sd) != SIM_RC_OK) + { + /* Uninstall the modules to avoid memory leaks, + file descriptor leaks, etc. */ + sim_module_uninstall (sd); + return 0; + } + return sd; } |