This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

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


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


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