Bill Wendling | bdc38e5 | 2010-03-09 18:31:07 +0000 | [diff] [blame^] | 1 | //===-- llvm/Target/ARMTargetObjectFile.cpp - ARM Object Info Impl --------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "ARMTargetObjectFile.h" |
| 11 | #include "ARMSubtarget.h" |
| 12 | #include "llvm/MC/MCSectionELF.h" |
| 13 | #include "llvm/MC/MCSectionMachO.h" |
| 14 | #include "llvm/Support/Dwarf.h" |
| 15 | #include "llvm/Target/TargetMachine.h" |
| 16 | using namespace llvm; |
| 17 | using namespace dwarf; |
| 18 | |
| 19 | //===----------------------------------------------------------------------===// |
| 20 | // ELF Target |
| 21 | //===----------------------------------------------------------------------===// |
| 22 | |
| 23 | void ARMElfTargetObjectFile::Initialize(MCContext &Ctx, |
| 24 | const TargetMachine &TM) { |
| 25 | TargetLoweringObjectFileELF::Initialize(Ctx, TM); |
| 26 | |
| 27 | if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) { |
| 28 | StaticCtorSection = |
| 29 | getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY, |
| 30 | MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, |
| 31 | SectionKind::getDataRel()); |
| 32 | StaticDtorSection = |
| 33 | getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY, |
| 34 | MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, |
| 35 | SectionKind::getDataRel()); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | //===----------------------------------------------------------------------===// |
| 40 | // Mach-O Target |
| 41 | //===----------------------------------------------------------------------===// |
| 42 | |
| 43 | void ARMMachOTargetObjectFile::Initialize(MCContext &Ctx, |
| 44 | const TargetMachine &TM) { |
| 45 | TargetLoweringObjectFileMachO::Initialize(Ctx, TM); |
| 46 | |
| 47 | // Exception Handling. |
| 48 | LSDASection = getMachOSection("__TEXT", "__gcc_except_tab", 0, |
| 49 | SectionKind::getReadOnlyWithRel()); |
| 50 | } |
| 51 | |
| 52 | unsigned ARMMachOTargetObjectFile::getTTypeEncoding() const { |
| 53 | return DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4; |
| 54 | } |