X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FARM%2FARMTargetObjectFile.cpp;h=7ec71b20c64d41395a91495ca498d39d7d624efe;hb=960ede2e1d3387719cf4176582883d60dec6f67b;hp=163971f96fefa5b0d8f60e0d4dd74d72cd8fef83;hpb=c85dca66e68c9fa6ffa8471c64113b12d8d94fb1;p=oota-llvm.git diff --git a/lib/Target/ARM/ARMTargetObjectFile.cpp b/lib/Target/ARM/ARMTargetObjectFile.cpp index 163971f96fe..7ec71b20c64 100644 --- a/lib/Target/ARM/ARMTargetObjectFile.cpp +++ b/lib/Target/ARM/ARMTargetObjectFile.cpp @@ -9,10 +9,13 @@ #include "ARMTargetObjectFile.h" #include "ARMSubtarget.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/MC/MCContext.h" +#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCSectionELF.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/ELF.h" +#include "llvm/Target/Mangler.h" #include "llvm/Target/TargetMachine.h" using namespace llvm; using namespace dwarf; @@ -23,24 +26,28 @@ using namespace dwarf; void ARMElfTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM) { + bool isAAPCS_ABI = TM.getSubtarget().isAAPCS_ABI(); TargetLoweringObjectFileELF::Initialize(Ctx, TM); + InitializeELF(isAAPCS_ABI); - if (TM.getSubtarget().isAAPCS_ABI()) { - StaticCtorSection = - getContext().getELFSection(".init_array", ELF::SHT_INIT_ARRAY, - MCSectionELF::SHF_WRITE | - MCSectionELF::SHF_ALLOC, - SectionKind::getDataRel()); - StaticDtorSection = - getContext().getELFSection(".fini_array", ELF::SHT_FINI_ARRAY, - MCSectionELF::SHF_WRITE | - MCSectionELF::SHF_ALLOC, - SectionKind::getDataRel()); + if (isAAPCS_ABI) { + LSDASection = NULL; } - + AttributesSection = getContext().getELFSection(".ARM.attributes", ELF::SHT_ARM_ATTRIBUTES, 0, SectionKind::getMetadata()); } + +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(getSymbol(*Mang, GV), + MCSymbolRefExpr::VK_ARM_TARGET2, + getContext()); +}