diff options
author | Martin Storsjo <martin@martin.st> | 2019-06-14 21:02:04 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2019-06-14 21:02:04 +0000 |
commit | c3b1d730d69fbb66e521a3abe1c56053ae4f94e2 (patch) | |
tree | 5c72997969d47213e388941d942264b57762c440 /lld/COFF/InputFiles.cpp | |
parent | 9e5fa333782be47570906b6744c4d6e6e17db1fc (diff) | |
download | bcm5719-llvm-c3b1d730d69fbb66e521a3abe1c56053ae4f94e2.tar.gz bcm5719-llvm-c3b1d730d69fbb66e521a3abe1c56053ae4f94e2.zip |
[COFF] Handle .eh_frame$symbol as associative comdat for MinGW
This matches how it is done for .xdata and .pdata already.
On i386, the symbol name in the section name suffix does not contain
the extra underscore prefix.
This is one part of a fix for PR42217.
Differential Revision: https://reviews.llvm.org/D63350
llvm-svn: 363456
Diffstat (limited to 'lld/COFF/InputFiles.cpp')
-rw-r--r-- | lld/COFF/InputFiles.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp index 538a36e9508..ebf6e441843 100644 --- a/lld/COFF/InputFiles.cpp +++ b/lld/COFF/InputFiles.cpp @@ -288,6 +288,8 @@ void ObjFile::recordPrevailingSymbolForMingw( if (SC && SC->getOutputCharacteristics() & IMAGE_SCN_MEM_EXECUTE) { StringRef Name; COFFObj->getSymbolName(Sym, Name); + if (getMachineType() == I386) + Name.consume_front("_"); PrevailingSectionMap[Name] = SectionNumber; } } @@ -297,9 +299,10 @@ void ObjFile::maybeAssociateSEHForMingw( const DenseMap<StringRef, uint32_t> &PrevailingSectionMap) { StringRef Name; COFFObj->getSymbolName(Sym, Name); - if (Name.consume_front(".pdata$") || Name.consume_front(".xdata$")) { - // For MinGW, treat .[px]data$<func> as implicitly associative to - // the symbol <func>. + if (Name.consume_front(".pdata$") || Name.consume_front(".xdata$") || + Name.consume_front(".eh_frame$")) { + // For MinGW, treat .[px]data$<func> and .eh_frame$<func> as implicitly + // associative to the symbol <func>. auto ParentSym = PrevailingSectionMap.find(Name); if (ParentSym != PrevailingSectionMap.end()) readAssociativeDefinition(Sym, Def, ParentSym->second); |