Fix @pltoff linker segfault for non-shared link.
[deliverable/binutils-gdb.git] / bfd / simple.c
index 0744215d24d9039535de0b88f7a626fa36c47b22..5039911dcfdf1356793a6df6a83bdfcc33019ea3 100644 (file)
@@ -143,10 +143,11 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
 
   if (! (sec->flags & SEC_RELOC))
     {
+      bfd_size_type amt = sec->rawsize > sec->size ? sec->rawsize : sec->size;
       bfd_size_type size = sec->rawsize ? sec->rawsize : sec->size;
 
       if (outbuf == NULL)
-       contents = bfd_malloc (size);
+       contents = bfd_malloc (amt);
       else
        contents = outbuf;
 
This page took 0.023655 seconds and 4 git commands to generate.