diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-02 01:34:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-02 01:34:32 +0000 |
commit | d5bbb07ec806e6fa1e804afd7073987fdacc83e4 (patch) | |
tree | cfc4d2c2187d044c70d23c05086d146dce8ff69e /lib/Target/TargetLoweringObjectFile.cpp | |
parent | 967ce7f5e1239be52386afa0439d2c433809aeeb (diff) |
move getDwarfExceptionSection from TAI to TLOF and rename it to
getLSDASection() to be more specific. This makes it pretty obvious
that the ELF LSDA section is being specified wrong in PIC mode. We're
probably getting a lot of startup-time relocations to a readonly page,
which is expensive and bad.
Someone who cares about ELF C++ should investigate this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77847 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | lib/Target/TargetLoweringObjectFile.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp index a86946da9f..d04e5c0cd6 100644 --- a/lib/Target/TargetLoweringObjectFile.cpp +++ b/lib/Target/TargetLoweringObjectFile.cpp @@ -36,6 +36,7 @@ TargetLoweringObjectFile::TargetLoweringObjectFile() : Ctx(0) { ReadOnlySection = 0; StaticCtorSection = 0; StaticDtorSection = 0; + LSDASection = 0; } TargetLoweringObjectFile::~TargetLoweringObjectFile() { @@ -302,6 +303,14 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx, getOrCreateSection(".ctors", false, SectionKind::getDataRel()); StaticDtorSection = getOrCreateSection(".dtors", false, SectionKind::getDataRel()); + + + // FIXME: We're emitting LSDA info into a readonly section on ELF, 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 = + getOrCreateSection(".gcc_except_table", false, SectionKind::getReadOnly()); } @@ -537,6 +546,8 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx, getOrCreateSection(".mod_term_func", true, SectionKind::getDataRel()); } + LSDASection = getOrCreateSection("__DATA,__gcc_except_tab", false, + SectionKind::getDataRel()); } const MCSection *TargetLoweringObjectFileMachO:: |