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/ADT/StringExtras.h"
13 #include "llvm/IR/Mangler.h"
14 #include "llvm/MC/MCContext.h"
15 #include "llvm/MC/MCExpr.h"
16 #include "llvm/MC/MCSectionELF.h"
17 #include "llvm/Support/Dwarf.h"
18 #include "llvm/Support/ELF.h"
19 #include "llvm/Target/TargetMachine.h"
21 using namespace dwarf;
23 //===----------------------------------------------------------------------===//
25 //===----------------------------------------------------------------------===//
27 void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
28 const TargetMachine &TM) {
29 bool isAAPCS_ABI = TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI();
30 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
31 InitializeELF(isAAPCS_ABI);
38 getContext().getELFSection(".ARM.attributes",
39 ELF::SHT_ARM_ATTRIBUTES,
41 SectionKind::getMetadata());
44 const MCExpr *ARMElfTargetObjectFile::getTTypeGlobalReference(
45 const GlobalValue *GV, unsigned Encoding, Mangler &Mang,
46 MachineModuleInfo *MMI, MCStreamer &Streamer) const {
47 assert(Encoding == DW_EH_PE_absptr && "Can handle absptr encoding only");
49 return MCSymbolRefExpr::Create(getSymbol(GV, Mang),
50 MCSymbolRefExpr::VK_ARM_TARGET2,
54 const MCExpr *ARMElfTargetObjectFile::
55 getDebugThreadLocalSymbol(const MCSymbol *Sym) const {
56 return MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_ARM_TLSLDO,