symbol reader tweak
Richard Henderson
rth@twiddle.net
Wed Dec 12 11:08:00 GMT 2001
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)
More information about the Binutils
mailing list