blob: 721a225183f436f1047dba799efa6344da399e95 [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"
Rafael Espindolac85dca62011-01-23 04:28:49 +000015#include "llvm/Support/ELF.h"
Bill Wendlingbdc38e52010-03-09 18:31:07 +000016#include "llvm/Target/TargetMachine.h"
17using namespace llvm;
18using namespace dwarf;
19
20//===----------------------------------------------------------------------===//
21// ELF Target
22//===----------------------------------------------------------------------===//
23
24void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
25 const TargetMachine &TM) {
26 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
27
28 if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) {
29 StaticCtorSection =
Rafael Espindolac85dca62011-01-23 04:28:49 +000030 getContext().getELFSection(".init_array", ELF::SHT_INIT_ARRAY,
Rafael Espindola1c130262011-01-23 04:43:11 +000031 ELF::SHF_WRITE |
32 ELF::SHF_ALLOC,
Chris Lattner287df1b2010-04-08 21:34:17 +000033 SectionKind::getDataRel());
Bill Wendlingbdc38e52010-03-09 18:31:07 +000034 StaticDtorSection =
Rafael Espindolac85dca62011-01-23 04:28:49 +000035 getContext().getELFSection(".fini_array", ELF::SHT_FINI_ARRAY,
Rafael Espindola1c130262011-01-23 04:43:11 +000036 ELF::SHF_WRITE |
37 ELF::SHF_ALLOC,
Chris Lattner287df1b2010-04-08 21:34:17 +000038 SectionKind::getDataRel());
Anton Korobeynikov0cb2a452011-12-03 23:49:37 +000039 StructorOutputOrder = Structors::PriorityOrder;
Anton Korobeynikovb5e16af2011-03-05 18:43:15 +000040 LSDASection = NULL;
Bill Wendlingbdc38e52010-03-09 18:31:07 +000041 }
Anton Korobeynikovb5e16af2011-03-05 18:43:15 +000042
Jason W Kim17b443d2010-10-11 23:01:44 +000043 AttributesSection =
44 getContext().getELFSection(".ARM.attributes",
Rafael Espindolac85dca62011-01-23 04:28:49 +000045 ELF::SHT_ARM_ATTRIBUTES,
Jason W Kim17b443d2010-10-11 23:01:44 +000046 0,
47 SectionKind::getMetadata());
Bill Wendlingbdc38e52010-03-09 18:31:07 +000048}