Chris Lattner | 80ec279 | 2009-08-02 00:34:36 +0000 | [diff] [blame] | 1 | //===-- llvm/Target/ARMTargetObjectFile.h - ARM Object Info -----*- C++ -*-===// |
| 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 | #ifndef LLVM_TARGET_ARM_TARGETOBJECTFILE_H |
| 11 | #define LLVM_TARGET_ARM_TARGETOBJECTFILE_H |
| 12 | |
| 13 | #include "llvm/Target/TargetLoweringObjectFile.h" |
Bruno Cardoso Lopes | b808588 | 2009-08-13 05:07:35 +0000 | [diff] [blame] | 14 | #include "llvm/MC/MCSectionELF.h" |
Chris Lattner | 80ec279 | 2009-08-02 00:34:36 +0000 | [diff] [blame] | 15 | |
| 16 | namespace llvm { |
Jim Grosbach | 764ab52 | 2009-08-11 15:33:49 +0000 | [diff] [blame] | 17 | |
Chris Lattner | 80ec279 | 2009-08-02 00:34:36 +0000 | [diff] [blame] | 18 | class ARMElfTargetObjectFile : public TargetLoweringObjectFileELF { |
| 19 | public: |
Chris Lattner | 892e182 | 2009-08-08 22:41:53 +0000 | [diff] [blame] | 20 | ARMElfTargetObjectFile() : TargetLoweringObjectFileELF() {} |
Jim Grosbach | 764ab52 | 2009-08-11 15:33:49 +0000 | [diff] [blame] | 21 | |
Chris Lattner | 80ec279 | 2009-08-02 00:34:36 +0000 | [diff] [blame] | 22 | void Initialize(MCContext &Ctx, const TargetMachine &TM) { |
| 23 | TargetLoweringObjectFileELF::Initialize(Ctx, TM); |
Jim Grosbach | 764ab52 | 2009-08-11 15:33:49 +0000 | [diff] [blame] | 24 | |
Chris Lattner | 80ec279 | 2009-08-02 00:34:36 +0000 | [diff] [blame] | 25 | if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) { |
| 26 | StaticCtorSection = |
Bruno Cardoso Lopes | b808588 | 2009-08-13 05:07:35 +0000 | [diff] [blame] | 27 | getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY, |
| 28 | MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, |
Chris Lattner | 0c0cb71 | 2009-08-08 20:22:20 +0000 | [diff] [blame] | 29 | SectionKind::getDataRel()); |
Chris Lattner | 80ec279 | 2009-08-02 00:34:36 +0000 | [diff] [blame] | 30 | StaticDtorSection = |
Bruno Cardoso Lopes | b808588 | 2009-08-13 05:07:35 +0000 | [diff] [blame] | 31 | getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY, |
| 32 | MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, |
Chris Lattner | 0c0cb71 | 2009-08-08 20:22:20 +0000 | [diff] [blame] | 33 | SectionKind::getDataRel()); |
Chris Lattner | 80ec279 | 2009-08-02 00:34:36 +0000 | [diff] [blame] | 34 | } |
| 35 | } |
| 36 | }; |
| 37 | } // end namespace llvm |
| 38 | |
| 39 | #endif |