From e3093808fb00e01bb1acae542f271f4c802e69b1 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Sat, 8 Dec 2018 18:15:41 +0000 Subject: [COFF] Map truncated .eh_frame section name PE/COFF sections can have section names truncated to 8 chars, in order to have the name available at runtime. (The string table, where long untruncated names are stored, isn't loaded at runtime.) This allows various llvm tools to dump the .eh_frame section from such executables. Patch by Peiyuan Song! Differential Revision: https://reviews.llvm.org/D55407 llvm-svn: 348708 --- llvm/lib/Object/COFFObjectFile.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/Object/COFFObjectFile.cpp') diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp index f09401307b4..2ac9c0e2321 100644 --- a/llvm/lib/Object/COFFObjectFile.cpp +++ b/llvm/lib/Object/COFFObjectFile.cpp @@ -1284,6 +1284,12 @@ bool COFFObjectFile::isRelocatableObject() const { return !DataDirectory; } +StringRef COFFObjectFile::mapDebugSectionName(StringRef Name) const { + return StringSwitch(Name) + .Case("eh_fram", "eh_frame") + .Default(Name); +} + bool ImportDirectoryEntryRef:: operator==(const ImportDirectoryEntryRef &Other) const { return ImportTable == Other.ImportTable && Index == Other.Index; -- cgit v1.2.3