2010-03-09 18:31:07 +00:00
|
|
|
//===-- llvm/Target/ARMTargetObjectFile.cpp - ARM Object Info Impl --------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "ARMTargetObjectFile.h"
|
|
|
|
#include "ARMSubtarget.h"
|
2012-12-03 16:50:05 +00:00
|
|
|
#include "llvm/ADT/StringExtras.h"
|
2010-04-08 21:34:17 +00:00
|
|
|
#include "llvm/MC/MCContext.h"
|
2012-11-14 01:47:00 +00:00
|
|
|
#include "llvm/MC/MCExpr.h"
|
2010-03-09 18:31:07 +00:00
|
|
|
#include "llvm/MC/MCSectionELF.h"
|
|
|
|
#include "llvm/Support/Dwarf.h"
|
2011-01-23 04:28:49 +00:00
|
|
|
#include "llvm/Support/ELF.h"
|
2012-12-03 16:50:05 +00:00
|
|
|
#include "llvm/Target/Mangler.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2010-03-09 18:31:07 +00:00
|
|
|
using namespace llvm;
|
|
|
|
using namespace dwarf;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// ELF Target
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
|
|
|
|
const TargetMachine &TM) {
|
2012-06-19 00:48:28 +00:00
|
|
|
bool isAAPCS_ABI = TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI();
|
2010-03-09 18:31:07 +00:00
|
|
|
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
|
2012-06-19 00:48:28 +00:00
|
|
|
InitializeELF(isAAPCS_ABI);
|
2010-03-09 18:31:07 +00:00
|
|
|
|
2012-01-25 22:24:19 +00:00
|
|
|
if (isAAPCS_ABI) {
|
2011-03-05 18:43:15 +00:00
|
|
|
LSDASection = NULL;
|
2010-03-09 18:31:07 +00:00
|
|
|
}
|
2011-03-05 18:43:15 +00:00
|
|
|
|
2010-10-11 23:01:44 +00:00
|
|
|
AttributesSection =
|
|
|
|
getContext().getELFSection(".ARM.attributes",
|
2011-01-23 04:28:49 +00:00
|
|
|
ELF::SHT_ARM_ATTRIBUTES,
|
2010-10-11 23:01:44 +00:00
|
|
|
0,
|
|
|
|
SectionKind::getMetadata());
|
2010-03-09 18:31:07 +00:00
|
|
|
}
|
2012-11-14 01:47:00 +00:00
|
|
|
|
|
|
|
const MCExpr *ARMElfTargetObjectFile::
|
|
|
|
getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
|
|
|
MachineModuleInfo *MMI, unsigned Encoding,
|
|
|
|
MCStreamer &Streamer) const {
|
|
|
|
assert(Encoding == DW_EH_PE_absptr && "Can handle absptr encoding only");
|
|
|
|
|
|
|
|
return MCSymbolRefExpr::Create(Mang->getSymbol(GV),
|
|
|
|
MCSymbolRefExpr::VK_ARM_TARGET2,
|
|
|
|
getContext());
|
|
|
|
}
|