patches/binutils/2.15/ld-2.15-stabs-tweak.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun May 20 13:48:26 2007 +0000 (2007-05-20)
changeset 112 ea15433daba0
permissions -rw-r--r--
Ah! I finally have a progress bar that doesn't stall the build!
- pipe size in Linux is only 8*512=4096 bytes
- pipe size is not setable
- when the feeding process spits out data faster than the eating
process can read it, then the feeding process stalls after 4KiB
of data sent to the pipe
- for us, the progress bar would spawn a sub-shell every line,
and the sub-shell would in turn spawn a 'date' command.
Which was sloooww as hell, and would cause some kind of a
starvation: the pipe was full most of the time, and the
feeding process was stalled all this time.

Now, we use internal variables and a little hack based onan offset
to determine the elapsed time. Much faster this way, but still
CPU-intensive.
yann@1
     1
Signed-off-by: dank@kegel.com
yann@1
     2
yann@1
     3
See http://sourceware.org/ml/binutils/2005-12/msg00270.html
yann@1
     4
http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html
yann@1
     5
yann@1
     6
STABS hash table size change, backported from the binutils CVS tree.  Here's
yann@1
     7
the CVS log comment for the original change:
yann@1
     8
yann@1
     9
revision 1.25
yann@1
    10
date: 2005/12/29 10:29:23;  author: nickc;  state: Exp;  lines: +2 -3
yann@1
    11
(_bfd_link_section_stabs): Use bfd_hash_table_init rather than
yann@1
    12
bfd_hash_table_init_n(...,251) so that the size of the hash table can be
yann@1
    13
controlled by the user.
yann@1
    14
yann@1
    15
Note that tunable hash table size changes were added after 2.15.  The effect
yann@1
    16
of this change is to make bfd use its default hash table size for the stabs
yann@1
    17
hash as well.
yann@1
    18
yann@1
    19
yann@1
    20
--- binutils-2.15/bfd/stabs.c.old	2004-05-17 15:36:04.000000000 -0400
yann@1
    21
+++ binutils-2.15/bfd/stabs.c	2006-02-09 15:21:56.567014000 -0500
yann@1
    22
@@ -241,9 +241,8 @@
yann@1
    23
 	goto error_return;
yann@1
    24
       /* Make sure the first byte is zero.  */
yann@1
    25
       (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
yann@1
    26
-      if (! bfd_hash_table_init_n (&sinfo->includes.root,
yann@1
    27
-				   stab_link_includes_newfunc,
yann@1
    28
-				   251))
yann@1
    29
+      if (! bfd_hash_table_init (&sinfo->includes.root,
yann@1
    30
+				   stab_link_includes_newfunc))
yann@1
    31
 	goto error_return;
yann@1
    32
       sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
yann@1
    33
       sinfo->stabstr->flags |= SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING;