Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
[deliverable/binutils-gdb.git] / bfd / coff-alpha.c
index 43530781e5a3ee02610b97537afe15068c67dcdc..49cb9df03ef08ef14165d98c1d1169e43969380b 100644 (file)
@@ -714,14 +714,17 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
 {
   bfd *input_bfd = link_order->u.indirect.section->owner;
   asection *input_section = link_order->u.indirect.section;
-  size_t reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
+  long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
   arelent **reloc_vector = NULL;
+  long reloc_count;
   bfd *output_bfd = relocateable ? abfd : (bfd *) NULL;
   bfd_vma gp;
   boolean gp_undefined;
   bfd_vma stack[RELOC_STACKSIZE];
   int tos = 0;
 
+  if (reloc_size < 0)
+    goto error_return;
   reloc_vector = (arelent **) malloc (reloc_size);
   if (reloc_vector == NULL && reloc_size != 0)
     {
@@ -737,9 +740,11 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
   input_section->_cooked_size = input_section->_raw_size;
   input_section->reloc_done = true;
 
-  if (bfd_canonicalize_reloc (input_bfd, input_section, reloc_vector,
-                             symbols)
-      == 0)
+  reloc_count = bfd_canonicalize_reloc (input_bfd, input_section,
+                                       reloc_vector, symbols);
+  if (reloc_count < 0)
+    goto error_return;
+  if (reloc_count == 0)
     goto successful_return;
 
   /* Get the GP value for the output BFD.  */
This page took 0.02389 seconds and 4 git commands to generate.