diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-04-10 19:40:34 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-12-27 00:54:41 -0500 |
commit | 5e744ef887c1e879052cb30783638807190275f8 (patch) | |
tree | decd6ae4c1ff57a091e5e9fbdcdda1abcfe5e502 /sim/cris | |
parent | 1b393626cef48974502e7077b191555b56680ee6 (diff) | |
download | gdb-5e744ef887c1e879052cb30783638807190275f8.zip gdb-5e744ef887c1e879052cb30783638807190275f8.tar.gz gdb-5e744ef887c1e879052cb30783638807190275f8.tar.bz2 |
sim: unify sim-hload
Pretty much all targets are using this module already, so add it to the
common list of objects. The only oddball out here is cris and that's
because it supports loading via an offset for all the phdrs. We drop
support for that.
Diffstat (limited to 'sim/cris')
-rw-r--r-- | sim/cris/ChangeLog | 4 | ||||
-rw-r--r-- | sim/cris/sim-if.c | 46 |
2 files changed, 4 insertions, 46 deletions
diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog index f2be067..d6c6b41 100644 --- a/sim/cris/ChangeLog +++ b/sim/cris/ChangeLog @@ -1,3 +1,7 @@ +2015-12-27 Mike Frysinger <vapier@gentoo.org> + + * sim-if.c (cris_program_offset_write, sim_load): Delete. + 2015-12-26 Mike Frysinger <vapier@gentoo.org> * config.in, configure: Regenerate. diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c index 72c0540..142bc7b 100644 --- a/sim/cris/sim-if.c +++ b/sim/cris/sim-if.c @@ -318,52 +318,6 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write) return TRUE; } -/* Helper for sim_load (needed just for ELF files): like sim_write, - but offset load at cris_program_offset offset. */ - -static int -cris_program_offset_write (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, - int length) -{ - return sim_write (sd, mem + cris_program_offset, buf, length); -} - -/* Replacement for ../common/sim-hload.c:sim_load, so we can treat ELF - files differently. */ - -SIM_RC -sim_load (SIM_DESC sd, const char *prog_name, struct bfd *prog_bfd, - int from_tty ATTRIBUTE_UNUSED) -{ - bfd *result_bfd; - - if (bfd_get_flavour (prog_bfd) != bfd_target_elf_flavour) - { - SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); - if (sim_analyze_program (sd, prog_name, prog_bfd) != SIM_RC_OK) - return SIM_RC_FAIL; - SIM_ASSERT (STATE_PROG_BFD (sd) != NULL); - - result_bfd = sim_load_file (sd, STATE_MY_NAME (sd), - STATE_CALLBACK (sd), - prog_name, - STATE_PROG_BFD (sd), - STATE_OPEN_KIND (sd) == SIM_OPEN_DEBUG, - STATE_LOAD_AT_LMA_P (sd), - sim_write); - if (result_bfd == NULL) - { - bfd_close (STATE_PROG_BFD (sd)); - STATE_PROG_BFD (sd) = NULL; - return SIM_RC_FAIL; - } - return SIM_RC_OK; - } - - return cris_load_elf_file (sd, prog_bfd, cris_program_offset_write) - ? SIM_RC_OK : SIM_RC_FAIL; -} - /* Cover function of sim_state_free to free the cpu buffers as well. */ static void |