This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: 3.2 code bloat from debug info


Glenn Burkhardt wrote:
I've found quite a few references to increased executable size from
debug info when g++ 3.2 is used

Most GCC work is done by volunteers, and it is impossible to predict when volunteers will contribute new functionality.


The problem is still not completely solved, but there have been a few half measures.

Red Hat has contributed binutils/gdb patches that allow one to keep the debug info in a separate file. Thus you can have a 6MB executable and a separate 24MB debug info file which can be shipped separately, or not at all. I don't know exactly how this works. I see that there are new objdump options --only-keep-debugging and --add-gnu-debuglink. So I think you use the first to create the debug info file, and the second to strip the executable and add a pointer to the debug info file.

There are some gcc options to eliminate possibly unnecessary debug info, --feliminate-unused-debug-types and -feliminate-unused-debug-symbols. These eliminate debug info for types/symbols that are not used by the program. This should be OK in most cases, but can be a problem if you have types/symbols that appear to be unused, but actually are used if a module is loaded, or if gdb is used, etc.

There is an option -feliminate-dwarf2-dups which attempts to solve the real problem, however, it is incomplete, and I don't think it is used much. In its current state, I don't know if it is useful or usable. Note that a successful compile does not mean that the feature is usable. It is usable if you can still debug all parts of your application, which is a much harder thing to verify.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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