blob: 03d1e2c764dea9096f326626b5ed1d25fb85d081 [file] [log] [blame]
Tom Stellarde135ffd2015-09-25 21:41:28 +00001//===-- 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
Tom Stellardc93fc112015-12-10 02:13:01 +000010#include "AMDGPUTargetObjectFile.h"
Tom Stellard00f2f912015-12-02 19:47:57 +000011#include "AMDGPU.h"
Tom Stellarde135ffd2015-09-25 21:41:28 +000012#include "Utils/AMDGPUBaseInfo.h"
13#include "llvm/MC/MCContext.h"
14#include "llvm/MC/MCSectionELF.h"
15#include "llvm/Support/ELF.h"
16
17using namespace llvm;
18
Tom Stellardc93fc112015-12-10 02:13:01 +000019//===----------------------------------------------------------------------===//
20// Generic Object File
21//===----------------------------------------------------------------------===//
22
23MCSection *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}