diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-09-04 17:42:03 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-09-04 17:42:03 +0000 |
commit | 7c4059eb8929eb2819ff81137033e190b1b550dd (patch) | |
tree | ba73a0bc6df98b5579e89a72bc14bac4f88e47c5 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 84897b8b7d01f5ccf7cb51e153f29c8bbb4f9191 (diff) | |
download | bcm5719-llvm-7c4059eb8929eb2819ff81137033e190b1b550dd.tar.gz bcm5719-llvm-7c4059eb8929eb2819ff81137033e190b1b550dd.zip |
MC Win64: Put unwind info for COMDAT code into the same COMDAT group
Summary:
This fixes a long standing issue where we would emit many little .text
sections and only one .pdata and .xdata section. Now we generate one
.pdata / .xdata pair per .text section and associate them correctly.
Fixes PR19667.
Reviewers: majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5181
llvm-svn: 217176
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 8820d10a0c6..a89769f0535 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -967,29 +967,14 @@ emitModuleFlags(MCStreamer &Streamer, } } -static const MCSection *getAssociativeCOFFSection(MCContext &Ctx, - const MCSection *Sec, - const MCSymbol *KeySym) { - // Return the normal section if we don't have to be associative. - if (!KeySym) - return Sec; - - // Make an associative section with the same name and kind as the normal - // section. - const MCSectionCOFF *SecCOFF = cast<MCSectionCOFF>(Sec); - unsigned Characteristics = - SecCOFF->getCharacteristics() | COFF::IMAGE_SCN_LNK_COMDAT; - return Ctx.getCOFFSection(SecCOFF->getSectionName(), Characteristics, - SecCOFF->getKind(), KeySym->getName(), - COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE); -} - const MCSection *TargetLoweringObjectFileCOFF::getStaticCtorSection( unsigned Priority, const MCSymbol *KeySym) const { - return getAssociativeCOFFSection(getContext(), StaticCtorSection, KeySym); + return getContext().getAssociativeCOFFSection( + cast<MCSectionCOFF>(StaticCtorSection), KeySym); } const MCSection *TargetLoweringObjectFileCOFF::getStaticDtorSection( unsigned Priority, const MCSymbol *KeySym) const { - return getAssociativeCOFFSection(getContext(), StaticDtorSection, KeySym); + return getContext().getAssociativeCOFFSection( + cast<MCSectionCOFF>(StaticDtorSection), KeySym); } |