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 
SelectSectionForGlobal(const GlobalValue * GV,SectionKind Kind,Mangler & Mang,const TargetMachine & TM) const23 MCSection *AMDGPUTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
24                                                           SectionKind Kind,
25                                                           Mangler &Mang,
26                                                 const TargetMachine &TM) const {
27   if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GV))
28     return TextSection;
29 
30   return TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, Mang, TM);
31 }
32