diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-18 06:13:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-18 06:13:03 +0000 |
commit | 5de2e2de9308e2bcbea85a24d877bb9eb145356e (patch) | |
tree | 3761be25796fcd36d801845b2ddd85edba1cf78e /llvm/lib/CodeGen/AsmPrinter | |
parent | e6e82b84808e68fafe58ba0383aaa54cdfb2597f (diff) | |
download | bcm5719-llvm-5de2e2de9308e2bcbea85a24d877bb9eb145356e.tar.gz bcm5719-llvm-5de2e2de9308e2bcbea85a24d877bb9eb145356e.zip |
add a horrible hack to the dwarf printer. It looks like mingw is not specifying
an EHFrame section, so we just emit ehframe data into a random section.
This is clearly bad.
llvm-svn: 79323
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp index 1d773ee53e7..7ab0bb0975a 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -56,7 +56,10 @@ void DwarfException::EmitCommonEHFrame(const Function *Personality, TD->getPointerSize() : -TD->getPointerSize(); // Begin eh frame section. - Asm->SwitchToSection(Asm->getObjFileLowering().getEHFrameSection()); + // FIXME: THIS IS A HORRIBLE HACK. MingW isn't specifying an EHFrame section. + if (const MCSection *EHFrameSec = + Asm->getObjFileLowering().getEHFrameSection()) + Asm->SwitchToSection(EHFrameSec); if (TAI->is_EHSymbolPrivate()) O << TAI->getPrivateGlobalPrefix(); @@ -150,8 +153,11 @@ void DwarfException::EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) { const Function *TheFunc = EHFrameInfo.function; - Asm->SwitchToSection(Asm->getObjFileLowering().getEHFrameSection()); - + // FIXME: THIS IS A HORRIBLE HACK. MingW isn't specifying an EHFrame section. + if (const MCSection *EHFrameSec = + Asm->getObjFileLowering().getEHFrameSection()) + Asm->SwitchToSection(EHFrameSec); + // Externally visible entry into the functions eh frame info. If the // corresponding function is static, this should not be externally visible. if (!TheFunc->hasLocalLinkage()) |