1 //===-- llvm/Target/ARMTargetObjectFile.cpp - ARM Object Info Impl --------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "ARMTargetObjectFile.h"
11 #include "ARMSubtarget.h"
12 #include "llvm/MC/MCSectionELF.h"
13 #include "llvm/Support/Dwarf.h"
14 #include "llvm/Target/TargetMachine.h"
16 using namespace dwarf;
18 //===----------------------------------------------------------------------===//
20 //===----------------------------------------------------------------------===//
22 void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
23 const TargetMachine &TM) {
24 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
26 if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) {
28 getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY,
29 MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC,
30 SectionKind::getDataRel());
32 getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY,
33 MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC,
34 SectionKind::getDataRel());