blob: 9703403db22a447f22ab7708d4713192f7cfb802 [file] [log] [blame]
Shih-wei Liaoe264f622010-02-10 11:10:31 -08001//===-- 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"
14#include "llvm/MC/MCSectionELF.h"
15
16namespace llvm {
17
18 class ARMElfTargetObjectFile : public TargetLoweringObjectFileELF {
19 public:
20 ARMElfTargetObjectFile() : TargetLoweringObjectFileELF() {}
21
22 void Initialize(MCContext &Ctx, const TargetMachine &TM) {
23 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
24
25 if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) {
26 StaticCtorSection =
27 getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY,
28 MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC,
29 SectionKind::getDataRel());
30 StaticDtorSection =
31 getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY,
32 MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC,
33 SectionKind::getDataRel());
34 }
35 }
36 };
37} // end namespace llvm
38
39#endif