Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/gnu/usr.bin/ld/ld Pull up revision 1.20 (requested by a...



details:   https://anonhg.NetBSD.org/src/rev/006ee2d91425
branches:  netbsd-1-4
changeset: 469633:006ee2d91425
user:      he <he%NetBSD.org@localhost>
date:      Fri Oct 22 09:23:17 1999 +0000

description:
Pull up revision 1.20 (requested by abs):
  Don't abuse alloca() for allocating string sections which can
  easily have a size of several megabytes, exceeding the hard stack
  limit on some ports.  Fixes PR#8547.

diffstat:

 gnu/usr.bin/ld/ld/lib.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r c28e0d450c94 -r 006ee2d91425 gnu/usr.bin/ld/ld/lib.c
--- a/gnu/usr.bin/ld/ld/lib.c   Wed Oct 20 23:58:01 1999 +0000
+++ b/gnu/usr.bin/ld/ld/lib.c   Fri Oct 22 09:23:17 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lib.c,v 1.19 1998/12/17 14:34:51 pk Exp $      */
+/*     $NetBSD: lib.c,v 1.19.2.1 1999/10/22 09:23:17 he Exp $  */
 
 /*
  *     - library routines
@@ -306,7 +306,7 @@
 
                        read_entry_symbols(fd, subentry);
                        subentry->strings = (char *)
-                               alloca(subentry->string_size);
+                               malloc(subentry->string_size);
                        read_entry_strings(fd, subentry);
 
                        /*
@@ -319,6 +319,7 @@
                                if (subentry->symbols)
                                        free(subentry->symbols);
                                free(subentry->filename);
+                               free(subentry->strings);
                                free(subentry);
                        } else {
                                /*
@@ -354,6 +355,7 @@
                                 * We'll read the strings again
                                 * if we need them.
                                 */
+                               free(subentry->strings);
                                subentry->strings = 0;
                        }
                }



Home | Main Index | Thread Index | Old Index