Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 1 | //===-- AMDGPUHSATargetObjectFile.cpp - AMDGPU Object Files ---------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "AMDGPUHSATargetObjectFile.h" |
| 11 | #include "Utils/AMDGPUBaseInfo.h" |
| 12 | #include "llvm/MC/MCContext.h" |
| 13 | #include "llvm/MC/MCSectionELF.h" |
| 14 | #include "llvm/Support/ELF.h" |
| 15 | |
| 16 | using namespace llvm; |
| 17 | |
| 18 | void AMDGPUHSATargetObjectFile::Initialize(MCContext &Ctx, |
| 19 | const TargetMachine &TM){ |
| 20 | TargetLoweringObjectFileELF::Initialize(Ctx, TM); |
| 21 | InitializeELF(TM.Options.UseInitArray); |
| 22 | |
| 23 | TextSection = AMDGPU::getHSATextSection(Ctx); |
| 24 | |
| 25 | } |
| 26 | |
| 27 | MCSection *AMDGPUHSATargetObjectFile::SelectSectionForGlobal( |
| 28 | const GlobalValue *GV, SectionKind Kind, |
| 29 | Mangler &Mang, |
| 30 | const TargetMachine &TM) const { |
| 31 | if (Kind.isText() && !GV->hasComdat()) |
| 32 | return getTextSection(); |
| 33 | |
| 34 | return TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, Mang, TM); |
| 35 | } |