This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] _bfd_vms_write_gsd segfaults
- From: Elias Athanasopoulos <eathan at otenet dot gr>
- To: binutils at sources dot redhat dot com
- Date: Mon, 4 Nov 2002 18:49:42 +0200
- Subject: [PATCH] _bfd_vms_write_gsd segfaults
Hi all,
With this patch _bfd_vms_write_gsd will not segfault when it is used with
a BFD built with --enable-targets=all in an i586-pc-linux-gnu system.
There are still problems in the vms code, but at least objcopy does not
crash. With the patch, I get:
[anteater@neutrino test]$ ~/bucvs/src/binutils/objcopy foo foo.vms -Ovms-vax
BFD: BFD 2.13.90 20021029 assertion fail libbfd.c:1241
BFD: BFD 2.13.90 20021029 assertion fail libbfd.c:1241
BFD: BFD 2.13.90 20021029 assertion fail libbfd.c:1241
BFD: BFD 2.13.90 20021029 assertion fail libbfd.c:1241
The above error is repeated for about 25-30 times and the resulted file
is raw data. I'll try to investigate deeper.
Elias
bfd/ChangeLog
2002-11-04 Elias Athanasopoulos <eathan@otenet.gr>
* vms-gsd.c (_bfd_vms_write_gsd): Check if symbol->udata.p is not
NULL.
===================================================================
RCS file: /home/anteater/bucvs/src/bfd/vms-gsd.c,v
retrieving revision 1.1
diff -u -p -r1.1 /home/anteater/bucvs/src/bfd/vms-gsd.c
--- /home/anteater/bucvs/src/bfd/vms-gsd.c 2002/11/04 00:35:53 1.1
+++ /home/anteater/bucvs/src/bfd/vms-gsd.c 2002/11/04 16:30:39
@@ -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;