* som.c (som_get_reloc_upper_bound): If there are no relocs return enough
authorNick Clifton <nickc@redhat.com>
Wed, 26 Sep 2007 08:12:59 +0000 (08:12 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 26 Sep 2007 08:12:59 +0000 (08:12 +0000)
  space to hold a NULL pointer.

bfd/ChangeLog
bfd/som.c

index 690c46d8ba27f4c8d736c4f90cbc68fcfd06aa91..f93f75669e5087e6c110d19ec417d44bd8454bb8 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-26  Tristan Gingold  <gingold@adacore.com>
+
+       * som.c (som_get_reloc_upper_bound): If there are no relocs return
+       enough space to hold a NULL pointer.
+
 2007-09-26  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-ppc.c (ppc_build_one_stub): Correct rel_hdr.sh_size.
index f36e3bc29285abf5b6061c54be5fac564f53780e..006af8cae2a914eabaf00b2316d40fcbdb7a9bd2 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -4939,8 +4939,11 @@ som_get_reloc_upper_bound (bfd *abfd, sec_ptr asect)
        return -1;
       return (asect->reloc_count + 1) * sizeof (arelent *);
     }
-  /* There are no relocations.  */
-  return 0;
+
+  /* There are no relocations.  Return enough space to hold the
+     NULL pointer which will be installed if som_canonicalize_reloc
+     is called.  */
+  return sizeof (arelent *);
 }
 
 /* Convert relocations from SOM (external) form into BFD internal
This page took 0.028704 seconds and 4 git commands to generate.