blob: 680d03254f10c3c400acf45a3350f143af67ff52 [file] [log] [blame]
Bill Wendlingbdc38e52010-03-09 18:31:07 +00001//===-- 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"
Bill Wendlingbdc38e52010-03-09 18:31:07 +000013#include "llvm/Support/Dwarf.h"
14#include "llvm/Target/TargetMachine.h"
15using namespace llvm;
16using namespace dwarf;
17
18//===----------------------------------------------------------------------===//
19// ELF Target
20//===----------------------------------------------------------------------===//
21
22void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
23 const TargetMachine &TM) {
24 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
25
26 if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) {
27 StaticCtorSection =
28 getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY,
29 MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC,
30 SectionKind::getDataRel());
31 StaticDtorSection =
32 getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY,
33 MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC,
34 SectionKind::getDataRel());
35 }
36}