This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: excessive stab information


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]