diff options
author | Martin Storsjo <martin@martin.st> | 2018-12-08 18:15:41 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-12-08 18:15:41 +0000 |
commit | e3093808fb00e01bb1acae542f271f4c802e69b1 (patch) | |
tree | ea2f6523e5c5ed385f2e438b42fff79a8923e848 /llvm/lib/Object/COFFObjectFile.cpp | |
parent | 83b0754586207a6475c6ecd2c4404802f13ba86c (diff) | |
download | bcm5719-llvm-e3093808fb00e01bb1acae542f271f4c802e69b1.tar.gz bcm5719-llvm-e3093808fb00e01bb1acae542f271f4c802e69b1.zip |
[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
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/COFFObjectFile.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<StringRef>(Name) + .Case("eh_fram", "eh_frame") + .Default(Name); +} + bool ImportDirectoryEntryRef:: operator==(const ImportDirectoryEntryRef &Other) const { return ImportTable == Other.ImportTable && Index == Other.Index; |