Why does ld -r disable ELF .stab/.stabstr optimization ?

Earl Chew earl_chew@agilent.com
Wed Sep 25 06:36:00 GMT 2002


I'm using ld to create relocatable .o files using ELF (both MIPS
and PowerPC) to be loaded dynamically on a VxWorks system.
Our applications are fairly large (several MB), and
with debug symbols (stab) in place I see that the files are 400 MB
in size! Too large for gdb to handle gracefully.

Looking at the relocatable .o file, I see the bulk of the space
taken up by .stabstr. Digging deeper, I think the problem is that
.stabstr contains the same information duplicated many times.

I look in elflink.h elf_link_add_object_symbols, and see:

   /* If this is a non-traditional, non-relocateable link, try to
      optimize the handling of the .stab/.stabstr sections.  */
   if (! dynamic
       && ! info->relocateable
       && ! info->traditional_format
       && info->hash->creator->flavour == bfd_target_elf_flavour
       && (info->strip != strip_all && info->strip != strip_debugger))

As far as I can tell, in my case every predicate is satisfied _EXCEPT_
info->relocateable.

Why does the .stab/.stabstr optimization need to be disabled in
the case of a relocateable link?

Earl



More information about the Binutils mailing list