/* 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.
/* 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;
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;