2010-03-10 02:31:07 +08: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-04 00:50:05 +08:00
|
|
|
#include "llvm/ADT/StringExtras.h"
|
2010-04-09 05:34:17 +08:00
|
|
|
#include "llvm/MC/MCContext.h"
|
2012-11-14 09:47:00 +08:00
|
|
|
#include "llvm/MC/MCExpr.h"
|
2010-03-10 02:31:07 +08:00
|
|
|
#include "llvm/MC/MCSectionELF.h"
|
|
|
|
#include "llvm/Support/Dwarf.h"
|
2011-01-23 12:28:49 +08:00
|
|
|
#include "llvm/Support/ELF.h"
|
2012-12-04 00:50:05 +08:00
|
|
|
#include "llvm/Target/Mangler.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2010-03-10 02:31:07 +08:00
|
|
|
using namespace llvm;
|
|
|
|
using namespace dwarf;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// ELF Target
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
|
|
|
|
const TargetMachine &TM) {
|
2012-06-19 08:48:28 +08:00
|
|
|
bool isAAPCS_ABI = TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI();
|
2010-03-10 02:31:07 +08:00
|
|
|
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
|
2012-06-19 08:48:28 +08:00
|
|
|
InitializeELF(isAAPCS_ABI);
|
2010-03-10 02:31:07 +08:00
|
|
|
|
2012-01-26 06:24:19 +08:00
|
|
|
if (isAAPCS_ABI) {
|
2011-03-06 02:43:15 +08:00
|
|
|
LSDASection = NULL;
|
2010-03-10 02:31:07 +08:00
|
|
|
}
|
2011-03-06 02:43:15 +08:00
|
|
|
|
2010-10-12 07:01:44 +08:00
|
|
|
AttributesSection =
|
|
|
|
getContext().getELFSection(".ARM.attributes",
|
2011-01-23 12:28:49 +08:00
|
|
|
ELF::SHT_ARM_ATTRIBUTES,
|
2010-10-12 07:01:44 +08:00
|
|
|
0,
|
|
|
|
SectionKind::getMetadata());
|
2010-03-10 02:31:07 +08:00
|
|
|
}
|
2012-11-14 09:47:00 +08: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());
|
|
|
|
}
|