1c93fc11fSTom Stellard //===-- AMDGPUHSATargetObjectFile.cpp - AMDGPU Object Files ---------------===// 2c93fc11fSTom Stellard // 3c93fc11fSTom Stellard // The LLVM Compiler Infrastructure 4c93fc11fSTom Stellard // 5c93fc11fSTom Stellard // This file is distributed under the University of Illinois Open Source 6c93fc11fSTom Stellard // License. See LICENSE.TXT for details. 7c93fc11fSTom Stellard // 8c93fc11fSTom Stellard //===----------------------------------------------------------------------===// 9c93fc11fSTom Stellard 10c93fc11fSTom Stellard #include "AMDGPUTargetObjectFile.h" 11c93fc11fSTom Stellard #include "AMDGPU.h" 12c93fc11fSTom Stellard #include "llvm/MC/MCContext.h" 13c93fc11fSTom Stellard #include "llvm/MC/MCSectionELF.h" 14c93fc11fSTom Stellard #include "llvm/Support/ELF.h" 1508326b62SKonstantin Zhuravlyov #include "Utils/AMDGPUBaseInfo.h" 16c93fc11fSTom Stellard 17c93fc11fSTom Stellard using namespace llvm; 18c93fc11fSTom Stellard 19c93fc11fSTom Stellard //===----------------------------------------------------------------------===// 20c93fc11fSTom Stellard // Generic Object File 21c93fc11fSTom Stellard //===----------------------------------------------------------------------===// 22c93fc11fSTom Stellard 234367c7fbSEric Christopher MCSection *AMDGPUTargetObjectFile::SelectSectionForGlobal( 24*6733564eSPeter Collingbourne const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { 25*6733564eSPeter Collingbourne if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GO) && 2608326b62SKonstantin Zhuravlyov AMDGPU::shouldEmitConstantsToTextSection(TM.getTargetTriple())) 27c93fc11fSTom Stellard return TextSection; 28c93fc11fSTom Stellard 29*6733564eSPeter Collingbourne return TargetLoweringObjectFileELF::SelectSectionForGlobal(GO, Kind, TM); 30c93fc11fSTom Stellard } 31