2015-09-26 05:41:28 +08:00
|
|
|
//===-- AMDGPUHSATargetObjectFile.cpp - AMDGPU Object Files ---------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2015-12-10 10:13:01 +08:00
|
|
|
#include "AMDGPUTargetObjectFile.h"
|
2015-12-03 03:47:57 +08:00
|
|
|
#include "AMDGPU.h"
|
2017-06-06 19:49:48 +08:00
|
|
|
#include "AMDGPUTargetMachine.h"
|
|
|
|
#include "Utils/AMDGPUBaseInfo.h"
|
2017-06-07 11:48:56 +08:00
|
|
|
#include "llvm/BinaryFormat/ELF.h"
|
2015-09-26 05:41:28 +08:00
|
|
|
#include "llvm/MC/MCContext.h"
|
|
|
|
#include "llvm/MC/MCSectionELF.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2015-12-10 10:13:01 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Generic Object File
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2016-09-16 15:33:15 +08:00
|
|
|
MCSection *AMDGPUTargetObjectFile::SelectSectionForGlobal(
|
2016-10-25 03:23:39 +08:00
|
|
|
const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
|
2017-11-02 03:12:38 +08:00
|
|
|
if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GO) &&
|
2016-10-21 02:12:38 +08:00
|
|
|
AMDGPU::shouldEmitConstantsToTextSection(TM.getTargetTriple()))
|
2015-12-10 10:13:01 +08:00
|
|
|
return TextSection;
|
|
|
|
|
2016-10-25 03:23:39 +08:00
|
|
|
return TargetLoweringObjectFileELF::SelectSectionForGlobal(GO, Kind, TM);
|
2015-12-10 10:13:01 +08:00
|
|
|
}
|