blob: 13fa7e202a003c3d4f10fb255e33319d531f016c [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"
14
15namespace llvm {
Jim Grosbach764ab522009-08-11 15:33:49 +000016
Chris Lattner80ec2792009-08-02 00:34:36 +000017 class ARMElfTargetObjectFile : public TargetLoweringObjectFileELF {
18 public:
Chris Lattner892e1822009-08-08 22:41:53 +000019 ARMElfTargetObjectFile() : TargetLoweringObjectFileELF() {}
Jim Grosbach764ab522009-08-11 15:33:49 +000020
Chris Lattner80ec2792009-08-02 00:34:36 +000021 void Initialize(MCContext &Ctx, const TargetMachine &TM) {
22 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
Jim Grosbach764ab522009-08-11 15:33:49 +000023
Chris Lattner80ec2792009-08-02 00:34:36 +000024 // FIXME: Add new attribute/flag to MCSection for init_array/fini_array.
25 // That will allow not treating these as "directives".
26 if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) {
27 StaticCtorSection =
Chris Lattner0c0cb712009-08-08 20:22:20 +000028 getELFSection("\t.section .init_array,\"aw\",%init_array", true,
29 SectionKind::getDataRel());
Chris Lattner80ec2792009-08-02 00:34:36 +000030 StaticDtorSection =
Chris Lattner0c0cb712009-08-08 20:22:20 +000031 getELFSection("\t.section .fini_array,\"aw\",%fini_array", true,
32 SectionKind::getDataRel());
Chris Lattner80ec2792009-08-02 00:34:36 +000033 }
34 }
35 };
36} // end namespace llvm
37
38#endif