]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is
authorDaniel Jacobowitz <drow@false.org>
Wed, 6 Nov 2002 04:34:59 +0000 (04:34 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 6 Nov 2002 04:34:59 +0000 (04:34 +0000)
        non-NULL before dereferencing.

        * vms.c (vms_object_p): Restore the start address when returning
        NULL.

bfd/ChangeLog
bfd/vms-gsd.c
bfd/vms.c

index 1e98cf5fb8b0e2175f90d8e075df7c9f4988acab..b5f3c6f254fab3df8c7730155d13ae79c952e61d 100644 (file)
@@ -1,9 +1,19 @@
 2002-11-06  David O'Brien  <obrien@FreeBSD.org>
-            Alan Modra  <amodra@bigpond.net.au>
+           Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of
        dynamic relocs against section symbols for the output section vma.
 
+2002-11-05  Elias Athanasopoulos  <eathan@otenet.gr>
+
+       * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is
+       non-NULL before dereferencing.
+
+2002-11-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * vms.c (vms_object_p): Restore the start address when returning
+       NULL.
+
 2002-10-31  David O'Brien  <obrien@FreeBSD.org>
 
        * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix
index 002412232dc2b1c64f37ef73875c478ccb4d2ae3..10fbb2d35c75bfc8ae0b4c4035133d3c7a426ba1 100644 (file)
@@ -420,7 +420,7 @@ _bfd_vms_slurp_gsd (abfd, objtype)
                        {
                          bfd_set_error (bfd_error_no_memory);
                          return -1;
-                       }
+                       }
                    }
                }
              else
@@ -661,13 +661,13 @@ _bfd_vms_slurp_gsd (abfd, objtype)
              }
            else        /* symbol reference */
              {
-               symbol->name =
+               symbol->name =
                  _bfd_vms_save_counted_string (vms_rec+8);
 #if VMS_DEBUG
                vms_debug(4, "egsd sym ref #%d (%s, %04x=%s)\n", abfd->symcount,
                           symbol->name, old_flags, flag2str(gsyflagdesc, old_flags));
 #endif
-               symbol->section = bfd_make_section (abfd, BFD_UND_SECTION_NAME);
+               symbol->section = bfd_make_section (abfd, BFD_UND_SECTION_NAME);
              }
 
            symbol->flags = new_flags;
@@ -901,7 +901,7 @@ _bfd_vms_write_gsd (abfd, objtype)
          unsigned long ca_psindx = 0;
          unsigned long psindx;
 
-         if (old_flags & BSF_FUNCTION)
+         if ((old_flags & BSF_FUNCTION) && symbol->udata.p != NULL)
            {
              code_address = ((asymbol *) (symbol->udata.p))->value;
              ca_psindx = ((asymbol *) (symbol->udata.p))->section->index;
index fc6bcc3e161b5450d32bbed9f143c14a2576552e..41a9717fcddedafa9284d1327b212d62020b0234 100644 (file)
--- a/bfd/vms.c
+++ b/bfd/vms.c
@@ -382,6 +382,7 @@ vms_object_p (abfd)
   const struct bfd_target *target_vector = 0;
   const bfd_arch_info_type *arch = 0;
   PTR tdata_save = abfd->tdata.any;
+  bfd_vma saddr_save = bfd_get_start_address (abfd);
 
 #if VMS_DEBUG
   vms_debug (1, "vms_object_p(%p)\n", abfd);
@@ -519,6 +520,7 @@ vms_object_p (abfd)
   if (abfd->tdata.any != tdata_save && abfd->tdata.any != NULL)
     bfd_release (abfd, abfd->tdata.any);
   abfd->tdata.any = tdata_save;
+  bfd_set_start_address (abfd, saddr_save);
   return NULL;
 }