[Lldb-commits] [PATCH] D18973: Find .plt section in object files generated by recent ld

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 12 10:17:39 PDT 2016


clayborg added a comment.

We can create a new SectionType enumeration in lldb-enumerations.h. Then in ObjectFileELF::CreateSections() we would classify the ".plt" section as eSectionTypeProcedureLinkageTable:

  static ConstString g_sect_name_plt (".plt");
  if (name == g_sect_name_plt)
      sect_type = eSectionTypeProcedureLinkageTable;

Then you can find sections by type no matter what the file format is. This isn't needed for this fix, but if sections contain common information in different file formats, this is handy to avoid having to know to look for sections by name. For instance, DWARF debug info is contained in ".debug_info" and ".debug_abbrev" in ELF, but in MachO the sections are "__debug_info" and "__debug_abbrev". So we made section types for them in the SectionType enumeration and then the DWARF parser just asks the lldb_private::ObjectFile for the sections by type (eSectionTypeDWARFDebugInfo and eSectionTypeDWARFDebugAbbrev).


http://reviews.llvm.org/D18973





More information about the lldb-commits mailing list