diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-03-09 18:31:07 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-03-09 18:31:07 +0000 |
commit | 9481181d405ac024426b7f38a1071f1314073eb6 (patch) | |
tree | 261ea5fb377e9b9d7de194d370a498baf227d72e /llvm/lib/Target/ARM/ARMTargetObjectFile.h | |
parent | c420c4cb4eb649226bc882749bac9e4ecc59b218 (diff) | |
download | bcm5719-llvm-9481181d405ac024426b7f38a1071f1314073eb6.tar.gz bcm5719-llvm-9481181d405ac024426b7f38a1071f1314073eb6.zip |
The ARM EH experiment worked!
Place the LSDA into the TEXT section for ARM platforms. This involves making the
encoding indirect, pcrel, and sdata4 instead of an absolute pointer. The
references to the type infos are then non-lazy pointers. Revision 98019 changed
the encoding of non-lazy pointers to add the symbol to the non-lazy pointer
definition if it's a local symbol (otherwise, it's external and set to '0' so
that the loader can adjust it to the real value). This paved the way for this
change to work on ARM.
llvm-svn: 98068
Diffstat (limited to 'llvm/lib/Target/ARM/ARMTargetObjectFile.h')
-rw-r--r-- | llvm/lib/Target/ARM/ARMTargetObjectFile.h | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetObjectFile.h b/llvm/lib/Target/ARM/ARMTargetObjectFile.h index a488c0a21fe..481d7abd310 100644 --- a/llvm/lib/Target/ARM/ARMTargetObjectFile.h +++ b/llvm/lib/Target/ARM/ARMTargetObjectFile.h @@ -11,29 +11,31 @@ #define LLVM_TARGET_ARM_TARGETOBJECTFILE_H #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" -#include "llvm/MC/MCSectionELF.h" namespace llvm { - class ARMElfTargetObjectFile : public TargetLoweringObjectFileELF { - public: - ARMElfTargetObjectFile() : TargetLoweringObjectFileELF() {} - - void Initialize(MCContext &Ctx, const TargetMachine &TM) { - TargetLoweringObjectFileELF::Initialize(Ctx, TM); - - if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) { - StaticCtorSection = - getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY, - MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, - SectionKind::getDataRel()); - StaticDtorSection = - getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY, - MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, - SectionKind::getDataRel()); - } - } - }; +class MCContext; +class TargetMachine; + +class ARMElfTargetObjectFile : public TargetLoweringObjectFileELF { +public: + ARMElfTargetObjectFile() : TargetLoweringObjectFileELF() {} + + virtual void Initialize(MCContext &Ctx, const TargetMachine &TM); +}; + +// FIXME: This subclass isn't 100% necessary. It will become obsolete once we +// can place all LSDAs into the TEXT section. See +// <rdar://problem/6804645>. +class ARMMachOTargetObjectFile : public TargetLoweringObjectFileMachO { +public: + ARMMachOTargetObjectFile() : TargetLoweringObjectFileMachO() {} + + virtual void Initialize(MCContext &Ctx, const TargetMachine &TM); + + virtual unsigned getTTypeEncoding() const; +}; + } // end namespace llvm #endif |