This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: excessive stab information
- From: "Andy Chittenden" <AChittenden at bluearc dot com>
- To: "Dave Korn" <dave dot korn at artimi dot com>,"Ian Lance Taylor" <ian at airs dot com>
- Cc: <binutils at sourceware dot org>,"Martin Dorey" <mdorey at bluearc dot com>
- Date: Thu, 28 Apr 2005 16:07:36 +0100
- Subject: 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