blob: 091a3b3d8497b35a281d10f397438edb19c5deff [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"
Chris Lattner287df1b2010-04-08 21:34:17 +000012#include "llvm/MC/MCContext.h"
Bill Wendlingbdc38e52010-03-09 18:31:07 +000013#include "llvm/MC/MCSectionELF.h"
Bill Wendlingbdc38e52010-03-09 18:31:07 +000014#include "llvm/Support/Dwarf.h"
15#include "llvm/Target/TargetMachine.h"
16using namespace llvm;
17using namespace dwarf;
18
19//===----------------------------------------------------------------------===//
20// ELF Target
21//===----------------------------------------------------------------------===//
22
23void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
24 const TargetMachine &TM) {
25 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
26
27 if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) {
28 StaticCtorSection =
Chris Lattner287df1b2010-04-08 21:34:17 +000029 getContext().getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY,
30 MCSectionELF::SHF_WRITE |
31 MCSectionELF::SHF_ALLOC,
32 SectionKind::getDataRel());
Bill Wendlingbdc38e52010-03-09 18:31:07 +000033 StaticDtorSection =
Chris Lattner287df1b2010-04-08 21:34:17 +000034 getContext().getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY,
35 MCSectionELF::SHF_WRITE |
36 MCSectionELF::SHF_ALLOC,
37 SectionKind::getDataRel());
Bill Wendlingbdc38e52010-03-09 18:31:07 +000038 }
39}