[llvm-dev] [LLD] Support DWARF64, debug_info "sorting"

Cary Coutant via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 18 12:21:26 PST 2020


> > If the .debug_str section *by itself* exceeds 4GB, then yes any string
> > with a 32-bit reference to it must be in the first 4GB.  Strings that
> > have only 64-bit references to them can be sorted to the end of the
> > section, if necessary.  I wouldn't think anyone guarantees or cares
> > about the order of strings within a string section.
> >
> > But I think this would be the very last thing to care about, with regard
> > to DWARF-64 concerns.
>
> I guess that the relative size of the ".debug_str" section may vary and depends on the source code, particular build environment, and lots of other circumstances. I've checked some fresh built samples and always see that the section is usually close in size to ".debug_info" and sometimes even bigger. So, this section must be ordered similarly as all other debugging info sections.

I agree with Paul, and I'm surprised by your findings. Can you post
some actual numbers? In my experience, .debug_str is an order of
magnitude smaller than .debug_info. Perhaps the binaries you're
looking at haven't been string-merged?

-cary


More information about the llvm-dev mailing list