* config/bfin-parse.y (gen_multi_instr_1): Check anomaly
[deliverable/binutils-gdb.git] / bfd / simple.c
index 1b92a05791c0741e30106417b5f753a1c1155464..8e1c70b4a623da16d2e0eb1213ed1145066fba9d 100644 (file)
@@ -1,5 +1,5 @@
 /* simple.c -- BFD simple client routines
-   Copyright 2002, 2003, 2004, 2005, 2007
+   Copyright 2002, 2003, 2004, 2005, 2007, 2008, 2009
    Free Software Foundation, Inc.
    Contributed by MontaVista Software, Inc.
 
@@ -186,6 +186,7 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
 
   /* Fill in the bare minimum number of fields for our purposes.  */
   memset (&link_info, 0, sizeof (link_info));
+  link_info.output_bfd = abfd;
   link_info.input_bfds = abfd;
   link_info.input_bfds_tail = &abfd->link_next;
 
@@ -209,7 +210,8 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
   data = NULL;
   if (outbuf == NULL)
     {
-      data = bfd_malloc (sec->size);
+      bfd_size_type amt = sec->rawsize > sec->size ? sec->rawsize : sec->size;
+      data = bfd_malloc (amt);
       if (data == NULL)
        return NULL;
       outbuf = data;
This page took 0.024112 seconds and 4 git commands to generate.