blob: 9703403db22a447f22ab7708d4713192f7cfb802 [file] [log] [blame]
Chris Lattner80ec2792009-08-02 00:34:36 +00001//===-- 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 Lopesb8085882009-08-13 05:07:35 +000014#include "llvm/MC/MCSectionELF.h"
Chris Lattner80ec2792009-08-02 00:34:36 +000015
16namespace llvm {
Jim Grosbach764ab522009-08-11 15:33:49 +000017
Chris Lattner80ec2792009-08-02 00:34:36 +000018 class ARMElfTargetObjectFile : public TargetLoweringObjectFileELF {
19 public:
Chris Lattner892e1822009-08-08 22:41:53 +000020 ARMElfTargetObjectFile() : TargetLoweringObjectFileELF() {}
Jim Grosbach764ab522009-08-11 15:33:49 +000021
Chris Lattner80ec2792009-08-02 00:34:36 +000022 void Initialize(MCContext &Ctx, const TargetMachine &TM) {
23 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
Jim Grosbach764ab522009-08-11 15:33:49 +000024
Chris Lattner80ec2792009-08-02 00:34:36 +000025 if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) {
26 StaticCtorSection =
Bruno Cardoso Lopesb8085882009-08-13 05:07:35 +000027 getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY,
28 MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC,
Chris Lattner0c0cb712009-08-08 20:22:20 +000029 SectionKind::getDataRel());
Chris Lattner80ec2792009-08-02 00:34:36 +000030 StaticDtorSection =
Bruno Cardoso Lopesb8085882009-08-13 05:07:35 +000031 getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY,
32 MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC,
Chris Lattner0c0cb712009-08-08 20:22:20 +000033 SectionKind::getDataRel());
Chris Lattner80ec2792009-08-02 00:34:36 +000034 }
35 }
36 };
37} // end namespace llvm
38
39#endif