xref: /aosp_15_r20/external/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- AMDGPUHSATargetObjectFile.cpp - AMDGPU Object Files ---------------===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker 
10*9880d681SAndroid Build Coastguard Worker #include "AMDGPUTargetObjectFile.h"
11*9880d681SAndroid Build Coastguard Worker #include "AMDGPU.h"
12*9880d681SAndroid Build Coastguard Worker #include "Utils/AMDGPUBaseInfo.h"
13*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MCContext.h"
14*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MCSectionELF.h"
15*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/ELF.h"
16*9880d681SAndroid Build Coastguard Worker 
17*9880d681SAndroid Build Coastguard Worker using namespace llvm;
18*9880d681SAndroid Build Coastguard Worker 
19*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
20*9880d681SAndroid Build Coastguard Worker // Generic Object File
21*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
22*9880d681SAndroid Build Coastguard Worker 
SelectSectionForGlobal(const GlobalValue * GV,SectionKind Kind,Mangler & Mang,const TargetMachine & TM) const23*9880d681SAndroid Build Coastguard Worker MCSection *AMDGPUTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
24*9880d681SAndroid Build Coastguard Worker                                                           SectionKind Kind,
25*9880d681SAndroid Build Coastguard Worker                                                           Mangler &Mang,
26*9880d681SAndroid Build Coastguard Worker                                                 const TargetMachine &TM) const {
27*9880d681SAndroid Build Coastguard Worker   if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GV))
28*9880d681SAndroid Build Coastguard Worker     return TextSection;
29*9880d681SAndroid Build Coastguard Worker 
30*9880d681SAndroid Build Coastguard Worker   return TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, Mang, TM);
31*9880d681SAndroid Build Coastguard Worker }
32