aboutsummaryrefslogtreecommitdiff
path: root/sim/h8300/run.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/h8300/run.c')
-rw-r--r--sim/h8300/run.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sim/h8300/run.c b/sim/h8300/run.c
index f19488a..8921ae6 100644
--- a/sim/h8300/run.c
+++ b/sim/h8300/run.c
@@ -98,9 +98,16 @@ main (ac, av)
for (s = abfd->sections; s; s=s->next)
{
- char *buffer = malloc(bfd_section_size(abfd,s));
- bfd_get_section_contents(abfd, s, buffer, 0, bfd_section_size(abfd,s));
- sim_write(s->vma, buffer, bfd_section_size(abfd,s));
+ char *buffer;
+
+ if (s->flags & SEC_LOAD)
+ {
+
+ buffer = malloc(bfd_section_size(abfd,s));
+ bfd_get_section_contents(abfd, s, buffer, 0,
+ bfd_section_size (abfd, s));
+ sim_write(s->vma, buffer, bfd_section_size (abfd, s));
+ }
}
start_address = bfd_get_start_address(abfd);