excessive stab information

Andy Chittenden AChittenden@bluearc.com
Thu Apr 28 15:21:00 GMT 2005


I've now sorted out our #includes so that no header file defines a type
within a #ifdef. This did save around 3% on the size of an elf so thanks
for that suggestion. However, we still have massive stabs. Further
analysis of the output of objdump --stabs led me to develop this patch
to bfd/stabs.c which removes a further 2%: is it ok to apply?

cvs diff: Diffing .
Index: stabs.c
===================================================================
RCS file: /cvs/src/src/bfd/stabs.c,v
retrieving revision 1.22
diff -c -w -u -r1.22 stabs.c
cvs diff: conflicting specifications of output style
--- stabs.c     11 Apr 2005 08:23:04 -0000      1.22
+++ stabs.c     28 Apr 2005 15:01:39 -0000
@@ -27,6 +27,8 @@
 #include "libbfd.h"
 #include "aout/stab_gnu.h"
 #include "safe-ctype.h"
+#include <limits.h>
+#include <stdlib.h>
 
 /* Stabs entries use a 12 byte format:
      4 byte string table index
@@ -298,6 +300,10 @@
          struct stab_link_includes_entry * incl_entry;
          struct stab_link_includes_totals * t;
          struct stab_excl_list * ne;
+          char resolved_path[PATH_MAX];
+          
+          if (realpath(string, resolved_path) != 0)
+            string = resolved_path;
 
          symb = symb_rover = NULL;
          sum_chars = num_chars = 0;

-- 
Andy, BlueArc Engineering



More information about the Binutils mailing list