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/MCContext.h"
13 #include "llvm/MC/MCSectionELF.h"
14 #include "llvm/Support/Dwarf.h"
15 #include "llvm/Support/ELF.h"
16 #include "llvm/Target/TargetMachine.h"
18 using namespace dwarf
;
20 //===----------------------------------------------------------------------===//
22 //===----------------------------------------------------------------------===//
24 void ARMElfTargetObjectFile::Initialize(MCContext
&Ctx
,
25 const TargetMachine
&TM
) {
26 TargetLoweringObjectFileELF::Initialize(Ctx
, TM
);
28 if (TM
.getSubtarget
<ARMSubtarget
>().isAAPCS_ABI()) {
30 getContext().getELFSection(".init_array", ELF::SHT_INIT_ARRAY
,
33 SectionKind::getDataRel());
35 getContext().getELFSection(".fini_array", ELF::SHT_FINI_ARRAY
,
38 SectionKind::getDataRel());
43 getContext().getELFSection(".ARM.attributes",
44 ELF::SHT_ARM_ATTRIBUTES
,
46 SectionKind::getMetadata());