From: Daniel Jacobowitz Date: Wed, 6 Nov 2002 04:34:59 +0000 (+0000) Subject: * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is X-Git-Tag: binutils-2_13_1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03334fb9633c7052c5d609cedb587a2774848c8c;p=thirdparty%2Fbinutils-gdb.git * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is non-NULL before dereferencing. * vms.c (vms_object_p): Restore the start address when returning NULL. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1e98cf5fb8b..b5f3c6f254f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,9 +1,19 @@ 2002-11-06 David O'Brien - Alan Modra + Alan Modra * 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 + + * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is + non-NULL before dereferencing. + +2002-11-04 Kaz Kojima + + * vms.c (vms_object_p): Restore the start address when returning + NULL. + 2002-10-31 David O'Brien * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix diff --git a/bfd/vms-gsd.c b/bfd/vms-gsd.c index 002412232dc..10fbb2d35c7 100644 --- a/bfd/vms-gsd.c +++ b/bfd/vms-gsd.c @@ -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; diff --git a/bfd/vms.c b/bfd/vms.c index fc6bcc3e161..41a9717fcdd 100644 --- 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; }