This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
symbol reader tweak
- From: Richard Henderson <rth at twiddle dot net>
- To: binutils at sources dot redhat dot com
- Date: Wed, 12 Dec 2001 11:07:07 -0800
- Subject: symbol reader tweak
FreeBSD now returns a pointer to a PROT_NONE page for allocations
of size zero. This catches bogus dereferences of this pointer.
Applied to mainline.
r~
* syms.c (_bfd_generic_read_minisymbols): Early return for
no symbols. Patch from FreeBSD folk; exact origin unknown.
Index: syms.c
===================================================================
RCS file: /cvs/src/src/bfd/syms.c,v
retrieving revision 1.14
diff -u -p -r1.14 syms.c
--- syms.c 2001/09/19 05:33:13 1.14
+++ syms.c 2001/12/12 19:03:12
@@ -715,6 +715,8 @@ _bfd_generic_read_minisymbols (abfd, dyn
storage = bfd_get_symtab_upper_bound (abfd);
if (storage < 0)
goto error_return;
+ if (storage == 0)
+ return 0;
syms = (asymbol **) bfd_malloc ((bfd_size_type) storage);
if (syms == NULL)