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 "AMDGPUTargetObjectFile.h"
11 #include "AMDGPU.h"
12 #include "Utils/AMDGPUBaseInfo.h"
13 #include "llvm/MC/MCContext.h"
14 #include "llvm/MC/MCSectionELF.h"
15 #include "llvm/Support/ELF.h"
16 
17 using namespace llvm;
18 
19 //===----------------------------------------------------------------------===//
20 // Generic Object File
21 //===----------------------------------------------------------------------===//
22 
23 MCSection *AMDGPUTargetObjectFile::SelectSectionForGlobal(
24     const GlobalValue *GV, SectionKind Kind, const TargetMachine &TM) const {
25   if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GV))
26     return TextSection;
27 
28   return TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, TM);
29 }
30