[LLDB] [PECOFF] Look for the truncated ".eh_fram" section name

COFF section names can either be stored truncated to 8 chars, in the
section header, or as a longer section name, stored separately in the
string table.

libunwind locates the .eh_frame section by runtime introspection,
which only works for section names stored in the section header (as
the string table isn't mapped at runtime). To support this behaviour,
lld always truncates the section names for sections that will be
mapped, like .eh_frame.

Differential Revision: https://reviews.llvm.org/D70745
This commit is contained in:
Martin Storsjö
2019-10-16 00:01:15 +03:00
parent 2e5bb6d8d9
commit 934c025e9b
2 changed files with 94 additions and 1 deletions

View File

@@ -838,7 +838,8 @@ SectionType ObjectFilePECOFF::GetSectionType(llvm::StringRef sect_name,
.Case(".debug_ranges", eSectionTypeDWARFDebugRanges)
.Case(".debug_str", eSectionTypeDWARFDebugStr)
.Case(".debug_types", eSectionTypeDWARFDebugTypes)
.Case(".eh_frame", eSectionTypeEHFrame)
// .eh_frame can be truncated to 8 chars.
.Cases(".eh_frame", ".eh_fram", eSectionTypeEHFrame)
.Case(".gosymtab", eSectionTypeGoSymtab)
.Default(eSectionTypeInvalid);
if (section_type != eSectionTypeInvalid)