Symbol Separation

Devang Patel dpatel@apple.com
Tue Feb 4 03:20:00 GMT 2003


If one header is included in multiple source files then GCC adds
debugging information for that header in all .o files. After that
it becomes linker's responsibility to remove duplicate info to
avoid final binary image bloat.

When build time becomes a major issue, this scheme has drawbacks:
- GCC does lots of redundant work in generating same information
   in multiple .o files
- Time to link is significantly affected and it becomes huge part
   of incremental build.

On system like Mac OS X, where almost every source file includes
one or more large framework headers, this issue requires some
attention. To address this, I am implementing a scheme we have
named as  "Symbol Separation". Basic idea is to store debugging
information for header in separate .o file and GCC makes decision
about header by consulting availability of separate .o file. If
available then GCC will turn of debugging information for particular
header while compiling source file. It is build system's
responsibility to provide extra .o file with only debugging
information to linker.

I have first cut of implementation ready and I wanted to know if
people would be interested in it.  It works with STABS, because
that's what GCC uses on Mac OS X.

If require, I can send detailed document about Symbol Separation.

-Devang



More information about the Gcc mailing list