1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

fix COFF targets (mingw/cygwin) to provide ehframe and LSDA sections

llvm-svn: 79346
This commit is contained in:
Chris Lattner 2009-08-18 16:56:17 +00:00
parent f0cde76e79
commit 17c3a9cf99
2 changed files with 10 additions and 8 deletions

View File

@ -56,10 +56,7 @@ void DwarfException::EmitCommonEHFrame(const Function *Personality,
TD->getPointerSize() : -TD->getPointerSize();
// Begin eh frame section.
// FIXME: THIS IS A HORRIBLE HACK. MingW isn't specifying an EHFrame section.
if (const MCSection *EHFrameSec =
Asm->getObjFileLowering().getEHFrameSection())
Asm->SwitchToSection(EHFrameSec);
Asm->SwitchToSection(Asm->getObjFileLowering().getEHFrameSection());
if (TAI->is_EHSymbolPrivate())
O << TAI->getPrivateGlobalPrefix();
@ -153,10 +150,7 @@ void DwarfException::EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) {
const Function *TheFunc = EHFrameInfo.function;
// FIXME: THIS IS A HORRIBLE HACK. MingW isn't specifying an EHFrame section.
if (const MCSection *EHFrameSec =
Asm->getObjFileLowering().getEHFrameSection())
Asm->SwitchToSection(EHFrameSec);
Asm->SwitchToSection(Asm->getObjFileLowering().getEHFrameSection());
// Externally visible entry into the functions eh frame info. If the
// corresponding function is static, this should not be externally visible.

View File

@ -963,6 +963,14 @@ void TargetLoweringObjectFileCOFF::Initialize(MCContext &Ctx,
StaticDtorSection =
getCOFFSection(".dtors", false, SectionKind::getDataRel());
// FIXME: We're emitting LSDA info into a readonly section on COFF, even
// though it contains relocatable pointers. In PIC mode, this is probably a
// big runtime hit for C++ apps. Either the contents of the LSDA need to be
// adjusted or this should be a data section.
LSDASection =
getCOFFSection(".gcc_except_table", false, SectionKind::getReadOnly());
EHFrameSection =
getCOFFSection(".eh_frame", false, SectionKind::getDataRel());
// Debug info.
// FIXME: Don't use 'directive' mode here.