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"
|
2010-04-08 21:34:17 +00:00
|
|
|
#include "llvm/MC/MCContext.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"
|
2010-03-09 18:31:07 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
using namespace llvm;
|
|
|
|
using namespace dwarf;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// ELF Target
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
|
|
|
|
const TargetMachine &TM) {
|
|
|
|
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
|
|
|
|
|
|
|
|
if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) {
|
|
|
|
StaticCtorSection =
|
2011-01-23 04:28:49 +00:00
|
|
|
getContext().getELFSection(".init_array", ELF::SHT_INIT_ARRAY,
|
2011-01-23 04:43:11 +00:00
|
|
|
ELF::SHF_WRITE |
|
|
|
|
ELF::SHF_ALLOC,
|
2010-04-08 21:34:17 +00:00
|
|
|
SectionKind::getDataRel());
|
2010-03-09 18:31:07 +00:00
|
|
|
StaticDtorSection =
|
2011-01-23 04:28:49 +00:00
|
|
|
getContext().getELFSection(".fini_array", ELF::SHT_FINI_ARRAY,
|
2011-01-23 04:43:11 +00:00
|
|
|
ELF::SHF_WRITE |
|
|
|
|
ELF::SHF_ALLOC,
|
2010-04-08 21:34:17 +00:00
|
|
|
SectionKind::getDataRel());
|
2010-03-09 18:31:07 +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
|
|
|
}
|