public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Changing .dynstr to be more C++ friendly?
@ 2005-02-24  1:11 Chris Kirby
  2005-02-24 13:15 ` MIPS gas doesn't set SH_FLAG Brett Porter
  2005-02-24 13:58 ` Changing .dynstr to be more C++ friendly? Alan Modra
  0 siblings, 2 replies; 10+ messages in thread
From: Chris Kirby @ 2005-02-24  1:11 UTC (permalink / raw)
  To: binutils

We have a large C++ embedded project where we have some large (~7MB) .dynstr sections that are taking up a lot of memory.  I used objdump to dump out all of the dynamic strings, and I noticed two C++ features that contributed to the large string size:
1) namespaces and class names are at the front of the mangled symbol name
2) templates with multiple instantiations

Looking at the strings, I noticed that there are possibilities for compression:
- For functions in the same namespace / class (#1), they tended to have a common prefix.
- For instantiated templates (#2), they tended to end with the same suffix since they implement similar functions.

My thinking was that we could change the definition of an Elf symbol to not contain a single name, but rather N distinct name components (3 in this case).  Using the example above, we could use the first for the prefix, the second for the unique portion, and the third for the suffix.  The hope would be that the prefix and suffix strings would be shared across multiple symbols.

For C++ applications I think the compression possible would be fairly high.  How difficult do you think it would it be to add these additional strings to the elf symbol table entries?

- Chris Kirby 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-03-01 17:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-24  1:11 Changing .dynstr to be more C++ friendly? Chris Kirby
2005-02-24 13:15 ` MIPS gas doesn't set SH_FLAG Brett Porter
2005-02-28 19:38   ` Nick Clifton
2005-03-01  1:18     ` Eric Christopher
2005-03-01  9:47       ` Nick Clifton
2005-03-01 16:38         ` Brett Porter
2005-03-01 17:27         ` Eric Christopher
2005-02-24 13:58 ` Changing .dynstr to be more C++ friendly? Alan Modra
2005-02-24 17:14   ` Chris Kirby
2005-02-24 17:28     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).