blob: 3d85ca7d6995d1af5d68a3c77e9331a29d29c9ce [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"
Anton Korobeynikov4a99f592012-01-25 22:24:19 +000017#include "llvm/ADT/StringExtras.h"
Bill Wendlingbdc38e52010-03-09 18:31:07 +000018using namespace llvm;
19using namespace dwarf;
20
21//===----------------------------------------------------------------------===//
22// ELF Target
23//===----------------------------------------------------------------------===//
24
25void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
26 const TargetMachine &TM) {
Rafael Espindolad6b43a32012-06-19 00:48:28 +000027 bool isAAPCS_ABI = TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI();
Bill Wendlingbdc38e52010-03-09 18:31:07 +000028 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
Rafael Espindolad6b43a32012-06-19 00:48:28 +000029 InitializeELF(isAAPCS_ABI);
Bill Wendlingbdc38e52010-03-09 18:31:07 +000030
Anton Korobeynikov4a99f592012-01-25 22:24:19 +000031 if (isAAPCS_ABI) {
Anton Korobeynikovb5e16af2011-03-05 18:43:15 +000032 LSDASection = NULL;
Bill Wendlingbdc38e52010-03-09 18:31:07 +000033 }
Anton Korobeynikovb5e16af2011-03-05 18:43:15 +000034
Jason W Kim17b443d2010-10-11 23:01:44 +000035 AttributesSection =
36 getContext().getELFSection(".ARM.attributes",
Rafael Espindolac85dca62011-01-23 04:28:49 +000037 ELF::SHT_ARM_ATTRIBUTES,
Jason W Kim17b443d2010-10-11 23:01:44 +000038 0,
39 SectionKind::getMetadata());
Bill Wendlingbdc38e52010-03-09 18:31:07 +000040}