This is an archive of the discontinued LLVM Phabricator instance.

Delay removal of pubtypes and pubnames
AbandonedPublic

Authored by rafael on Jul 12 2017, 5:10 PM.

Details

Reviewers
ruiu
grimar
Summary

The reason for this is that I want to use the lld infrastructure for getting data and relocations.

This means that the data for .debug_gnu_pubnames will be just a InputSection->Data, which means we have to at least create a InputSection.

Diff Detail

Event Timeline

rafael created this revision.Jul 12 2017, 5:10 PM
grimar edited edge metadata.Jul 13 2017, 3:31 AM

This looks fine for me as is too, but have few ideas to share.

ELF/InputFiles.cpp
511

What about leaving it here (for consistency with others discarded sections), but marking as dead from start ?

  if (Config->GdbIndex &&
      (Name == ".debug_gnu_pubnames" || Name == ".debug_gnu_pubtypes")) {
   InputSectionBase *Sec = make<InputSection>(this, &Sec, Name);
   Script->discard({Sec});
   return Sec;
}
ELF/SyntheticSections.cpp
1763

Then this can remain getDebugInfoSections.

Or even we can have
GdbIndexSection::addDebugInfo() and call it during createInputSection() to
avoid scanning over input sections at all (though not sure how much iterating over
all input sections hits perfomance).

rafael abandoned this revision.Jul 13 2017, 10:46 AM