<div dir="ltr">Does that mean that object files for AMDGPU currently contain no relocations, and no relocations are defined for AMDGPU? (I'd like to add comments to AMDGPUTargetInfo member functions about why they are empty.)</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 7, 2016 at 9:09 AM, Tom Stellard <span dir="ltr"><<a href="mailto:tom@stellard.net" target="_blank">tom@stellard.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Jan 06, 2016 at 09:40:03PM -0800, Rui Ueyama via llvm-commits wrote:<br>
> Is this actually all you have to do to use the new ELF linker instead of<br>
> the old one for AMDGPU? I'm asking because this is a rather small patch.<br>
> Are you planning to do something in addition to this?<br>
><br>
<br>
</span>Hi,<br>
<br>
This is all that is required to use the new linker for our current set of<br>
tests cases (C++AMP conformance tests). It's possible in the future we<br>
may need to add relocation support to the executable file format, but I'm not<br>
sure about this.<br>
<br>
We are also considering a shared object format for AMDGPU, which would support<br>
additional features and potentially require some more changes to the linker,<br>
however, I don't have a lot of details on this yet.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Tom<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On Wed, Jan 6, 2016 at 7:59 PM, Tom Stellard via llvm-commits <<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
> > Author: tstellar<br>
> > Date: Wed Jan 6 21:59:08 2016<br>
> > New Revision: 257023<br>
> ><br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=257023&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=257023&view=rev</a><br>
> > Log:<br>
> > [ELF] Add AMDGPU support<br>
> ><br>
> > Summary: This will allow us to remove the AMDGPU support from old ELF.<br>
> ><br>
> > Reviewers: rafael, ruiu<br>
> ><br>
> > Differential Revision: <a href="http://reviews.llvm.org/D15895" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15895</a><br>
> ><br>
> > Added:<br>
> > lld/trunk/test/ELF/amdgpu-entry.s<br>
> > lld/trunk/test/ELF/amdgpu-globals.s<br>
> > lld/trunk/test/ELF/amdgpu-kernels.s<br>
> > Modified:<br>
> > lld/trunk/ELF/Driver.cpp<br>
> > lld/trunk/ELF/OutputSections.cpp<br>
> > lld/trunk/ELF/Target.cpp<br>
> > lld/trunk/ELF/Writer.cpp<br>
> ><br>
> > Modified: lld/trunk/ELF/Driver.cpp<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=257023&r1=257022&r2=257023&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=257023&r1=257022&r2=257023&view=diff</a><br>
> ><br>
> > ==============================================================================<br>
> > --- lld/trunk/ELF/Driver.cpp (original)<br>
> > +++ lld/trunk/ELF/Driver.cpp Wed Jan 6 21:59:08 2016<br>
> > @@ -253,6 +253,9 @@ void LinkerDriver::createFiles(opt::Inpu<br>
> ><br>
> > if (Config->GnuHash && Config->EMachine == EM_MIPS)<br>
> > error("The .gnu.hash section is not compatible with the MIPS<br>
> > target.");<br>
> > +<br>
> > + if (!Config->Entry.empty() && Config->EMachine == EM_AMDGPU)<br>
> > + error("-e option is not valid for AMDGPU.");<br>
> > }<br>
> ><br>
> > template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) {<br>
> > @@ -261,7 +264,10 @@ template <class ELFT> void LinkerDriver:<br>
> ><br>
> > if (!Config->Shared) {<br>
> > // Add entry symbol.<br>
> > - if (Config->Entry.empty())<br>
> > + //<br>
> > + // There is no entry symbol for AMDGPU binaries, so skip adding one<br>
> > to avoid<br>
> > + // having and undefined symbol.<br>
> > + if (Config->Entry.empty() && Config->EMachine != EM_AMDGPU)<br>
> > Config->Entry = (Config->EMachine == EM_MIPS) ? "__start" :<br>
> > "_start";<br>
> ><br>
> > // In the assembly for 32 bit x86 the _GLOBAL_OFFSET_TABLE_ symbol<br>
> ><br>
> > Modified: lld/trunk/ELF/OutputSections.cpp<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=257023&r1=257022&r2=257023&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=257023&r1=257022&r2=257023&view=diff</a><br>
> ><br>
> > ==============================================================================<br>
> > --- lld/trunk/ELF/OutputSections.cpp (original)<br>
> > +++ lld/trunk/ELF/OutputSections.cpp Wed Jan 6 21:59:08 2016<br>
> > @@ -788,6 +788,11 @@ typename ELFFile<ELFT>::uintX_t elf2::ge<br>
> > InputSectionBase<ELFT> *SC = DR.Section;<br>
> > if (!SC)<br>
> > return DR.Sym.st_value;<br>
> > +<br>
> > + // Symbol offsets for AMDGPU need to be the offset in bytes of the<br>
> > symbol<br>
> > + // from the beginning of the section.<br>
> > + if (Config->EMachine == EM_AMDGPU)<br>
> > + return SC->getOffset(DR.Sym);<br>
> > if (DR.Sym.getType() == STT_TLS)<br>
> > return SC->OutSec->getVA() + SC->getOffset(DR.Sym) -<br>
> > Out<ELFT>::TlsPhdr->p_vaddr;<br>
> > @@ -1325,7 +1330,11 @@ void SymbolTableSection<ELFT>::writeLoca<br>
> > continue;<br>
> > const OutputSectionBase<ELFT> *OutSec = Section->OutSec;<br>
> > ESym->st_shndx = OutSec->SectionIndex;<br>
> > - VA += OutSec->getVA() + Section->getOffset(Sym);<br>
> > + VA = Section->getOffset(Sym);<br>
> > + // Symbol offsets for AMDGPU need to be the offset in bytes of the<br>
> > + // symbol from the beginning of the section.<br>
> > + if (Config->EMachine != EM_AMDGPU)<br>
> > + VA += OutSec->getVA();<br>
> > }<br>
> > ESym->st_name = StrTabSec.addString(SymName);<br>
> > ESym->st_size = Sym.st_size;<br>
> ><br>
> > Modified: lld/trunk/ELF/Target.cpp<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=257023&r1=257022&r2=257023&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=257023&r1=257022&r2=257023&view=diff</a><br>
> ><br>
> > ==============================================================================<br>
> > --- lld/trunk/ELF/Target.cpp (original)<br>
> > +++ lld/trunk/ELF/Target.cpp Wed Jan 6 21:59:08 2016<br>
> > @@ -191,6 +191,22 @@ public:<br>
> > uint8_t *PairedLoc = nullptr) const override;<br>
> > };<br>
> ><br>
> > +class AMDGPUTargetInfo final : public TargetInfo {<br>
> > +public:<br>
> > + AMDGPUTargetInfo();<br>
> > + void writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const override;<br>
> > + void writePltZeroEntry(uint8_t *Buf, uint64_t GotEntryAddr,<br>
> > + uint64_t PltEntryAddr) const override;<br>
> > + void writePltEntry(uint8_t *Buf, uint64_t GotAddr, uint64_t<br>
> > GotEntryAddr,<br>
> > + uint64_t PltEntryAddr, int32_t Index,<br>
> > + unsigned RelOff) const override;<br>
> > + bool relocNeedsGot(uint32_t Type, const SymbolBody &S) const override;<br>
> > + bool relocNeedsPlt(uint32_t Type, const SymbolBody &S) const override;<br>
> > + void relocateOne(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, uint64_t<br>
> > P,<br>
> > + uint64_t SA, uint64_t ZA = 0,<br>
> > + uint8_t *PairedLoc = nullptr) const override;<br>
> > +};<br>
> > +<br>
> > template <class ELFT> class MipsTargetInfo final : public TargetInfo {<br>
> > public:<br>
> > MipsTargetInfo();<br>
> > @@ -216,6 +232,8 @@ TargetInfo *createTarget() {<br>
> > return new X86TargetInfo();<br>
> > case EM_AARCH64:<br>
> > return new AArch64TargetInfo();<br>
> > + case EM_AMDGPU:<br>
> > + return new AMDGPUTargetInfo();<br>
> > case EM_MIPS:<br>
> > switch (Config->EKind) {<br>
> > case ELF32LEKind:<br>
> > @@ -1315,6 +1333,38 @@ void AArch64TargetInfo::relocateOne(uint<br>
> > }<br>
> > }<br>
> ><br>
> > +AMDGPUTargetInfo::AMDGPUTargetInfo() {}<br>
> > +<br>
> > +void AMDGPUTargetInfo::writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const<br>
> > {<br>
> > + llvm_unreachable("not implemented");<br>
> > +}<br>
> > +<br>
> > +void AMDGPUTargetInfo::writePltZeroEntry(uint8_t *Buf, uint64_t<br>
> > GotEntryAddr,<br>
> > + uint64_t PltEntryAddr) const {<br>
> > + llvm_unreachable("not implemented");<br>
> > +}<br>
> > +<br>
> > +void AMDGPUTargetInfo::writePltEntry(uint8_t *Buf, uint64_t GotAddr,<br>
> > + uint64_t GotEntryAddr,<br>
> > + uint64_t PltEntryAddr, int32_t Index,<br>
> > + unsigned RelOff) const {<br>
> > + llvm_unreachable("not implemented");<br>
> > +}<br>
> > +<br>
> > +bool AMDGPUTargetInfo::relocNeedsGot(uint32_t Type, const SymbolBody &S)<br>
> > const {<br>
> > + return false;<br>
> > +}<br>
> > +<br>
> > +bool AMDGPUTargetInfo::relocNeedsPlt(uint32_t Type, const SymbolBody &S)<br>
> > const {<br>
> > + return false;<br>
> > +}<br>
> > +<br>
> > +void AMDGPUTargetInfo::relocateOne(uint8_t *Loc, uint8_t *BufEnd,<br>
> > uint32_t Type,<br>
> > + uint64_t P, uint64_t SA, uint64_t ZA,<br>
> > + uint8_t *PairedLoc) const {<br>
> > + llvm_unreachable("not implemented");<br>
> > +}<br>
> > +<br>
> > template <class ELFT> MipsTargetInfo<ELFT>::MipsTargetInfo() {<br>
> > PageSize = 65536;<br>
> > GotHeaderEntriesNum = 2;<br>
> ><br>
> > Modified: lld/trunk/ELF/Writer.cpp<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=257023&r1=257022&r2=257023&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=257023&r1=257022&r2=257023&view=diff</a><br>
> ><br>
> > ==============================================================================<br>
> > --- lld/trunk/ELF/Writer.cpp (original)<br>
> > +++ lld/trunk/ELF/Writer.cpp Wed Jan 6 21:59:08 2016<br>
> > @@ -975,6 +975,18 @@ static uint32_t toPhdrFlags(uint64_t Fla<br>
> > return Ret;<br>
> > }<br>
> ><br>
> > +/// For AMDGPU we need to use custom segment kinds in order to specify<br>
> > which<br>
> > +/// address space data should be loaded into.<br>
> > +template <class ELFT><br>
> > +static uint32_t getAmdgpuPhdr(OutputSectionBase<ELFT> *Sec) {<br>
> > + uint32_t Flags = Sec->getFlags();<br>
> > + if (Flags & SHF_AMDGPU_HSA_CODE)<br>
> > + return PT_AMDGPU_HSA_LOAD_CODE_AGENT;<br>
> > + if ((Flags & SHF_AMDGPU_HSA_GLOBAL) && !(Flags & SHF_AMDGPU_HSA_AGENT))<br>
> > + return PT_AMDGPU_HSA_LOAD_GLOBAL_PROGRAM;<br>
> > + return PT_LOAD;<br>
> > +}<br>
> > +<br>
> > template <class ELFT><br>
> > void Writer<ELFT>::updateRelro(Elf_Phdr *Cur, Elf_Phdr *GnuRelroPhdr,<br>
> > uintX_t VA) {<br>
> > @@ -1032,7 +1044,9 @@ template <class ELFT> void Writer<ELFT>:<br>
> > if (PH->p_flags != Flags) {<br>
> > // Flags changed. Create a new PT_LOAD.<br>
> > PH = &Phdrs[++PhdrIdx];<br>
> > - setPhdr(PH, PT_LOAD, Flags, FileOff, VA, 0,<br>
> > Target->getPageSize());<br>
> > + uint32_t PTType = (Config->EMachine != EM_AMDGPU) ?<br>
> > (uint32_t)PT_LOAD<br>
> > + :<br>
> > getAmdgpuPhdr(Sec);<br>
> > + setPhdr(PH, PTType, Flags, FileOff, VA, 0, Target->getPageSize());<br>
> > }<br>
> ><br>
> > if (Sec->getFlags() & SHF_TLS) {<br>
> ><br>
> > Added: lld/trunk/test/ELF/amdgpu-entry.s<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/amdgpu-entry.s?rev=257023&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/amdgpu-entry.s?rev=257023&view=auto</a><br>
> ><br>
> > ==============================================================================<br>
> > --- lld/trunk/test/ELF/amdgpu-entry.s (added)<br>
> > +++ lld/trunk/test/ELF/amdgpu-entry.s Wed Jan 6 21:59:08 2016<br>
> > @@ -0,0 +1,14 @@<br>
> > +# RUN: llvm-mc -filetype=obj -triple=amdgcpu--amdgcn -mcpu=kaveri %s -o<br>
> > %t.o<br>
> > +# RUN: not lld -e kernel0 -flavor gnu %t.o -o %t<br>
> > +<br>
> > +.hsa_code_object_version 1,0<br>
> > +.hsa_code_object_isa 7,0,0,"AMD","AMDGPU"<br>
> > +<br>
> > +.hsatext<br>
> > +.globl kernel0<br>
> > +.align 256<br>
> > +.amdgpu_hsa_kernel kernel0<br>
> > +kernel0:<br>
> > + s_endpgm<br>
> > +.Lfunc_end0:<br>
> > + .size kernel0, .Lfunc_end0-kernel0<br>
> ><br>
> > Added: lld/trunk/test/ELF/amdgpu-globals.s<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/amdgpu-globals.s?rev=257023&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/amdgpu-globals.s?rev=257023&view=auto</a><br>
> ><br>
> > ==============================================================================<br>
> > --- lld/trunk/test/ELF/amdgpu-globals.s (added)<br>
> > +++ lld/trunk/test/ELF/amdgpu-globals.s Wed Jan 6 21:59:08 2016<br>
> > @@ -0,0 +1,138 @@<br>
> > +# RUN: llvm-mc -filetype=obj -triple=amdgcpu--amdgcn -mcpu=kaveri %s -o<br>
> > %t.o<br>
> > +# RUN: lld -flavor gnu %t.o -o %t<br>
> > +# RUN: llvm-readobj -sections -symbols -program-headers %t | FileCheck %s<br>
> > +<br>
> > +# Requires: amdgpu<br>
> > +<br>
> > + .amdgpu_hsa_module_global module_global_program<br>
> > + .size module_global_program, 4<br>
> > + .hsadata_global_program<br>
> > +module_global_program:<br>
> > + .long 0 ; 0x0<br>
> > +<br>
> > + .amdgpu_hsa_program_global program_global_program<br>
> > + .size program_global_program, 4<br>
> > + .hsadata_global_program<br>
> > +program_global_program:<br>
> > + .long 0 ; 0x0<br>
> > +<br>
> > + .amdgpu_hsa_module_global module_global_agent<br>
> > + .size module_global_agent, 4<br>
> > + .hsadata_global_agent<br>
> > +module_global_agent:<br>
> > + .long 0 ; 0x0<br>
> > +<br>
> > + .amdgpu_hsa_program_global program_global_agent<br>
> > + .size program_global_agent, 4<br>
> > + .hsadata_global_agent<br>
> > +program_global_agent:<br>
> > + .long 0 ; 0x0<br>
> > +<br>
> > + .amdgpu_hsa_module_global module_global_readonly<br>
> > + .size module_global_readonly, 4<br>
> > + .hsatext<br>
> > +module_global_readonly:<br>
> > + .long 0 ; 0x0<br>
> > +<br>
> > + .amdgpu_hsa_program_global program_global_readonly<br>
> > + .size program_global_readonly, 4<br>
> > + .hsatext<br>
> > +program_global_readonly:<br>
> > + .long 0 ; 0x0<br>
> > +<br>
> > +# CHECK: Section {<br>
> > +# CHECK: Name: .hsadata_global_program<br>
> > +# CHECK: Type: SHT_PROGBITS (0x1)<br>
> > +# CHECK: Flags [ (0x100003)<br>
> > +# CHECK: SHF_ALLOC (0x2)<br>
> > +# CHECK: SHF_AMDGPU_HSA_GLOBAL (0x100000)<br>
> > +# CHECK: SHF_WRITE (0x1)<br>
> > +# CHECK: ]<br>
> > +# CHECK: Address: [[HSADATA_GLOBAL_PROGRAM_ADDR:[0-9xa-f]+]]<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: Section {<br>
> > +# CHECK: Name: .hsadata_global_agent<br>
> > +# CHECK: Type: SHT_PROGBITS (0x1)<br>
> > +# CHECK: Flags [ (0x900003)<br>
> > +# CHECK: SHF_ALLOC (0x2)<br>
> > +# CHECK: SHF_AMDGPU_HSA_AGENT (0x800000)<br>
> > +# CHECK: SHF_AMDGPU_HSA_GLOBAL (0x100000)<br>
> > +# CHECK: SHF_WRITE (0x1)<br>
> > +# CHECK: ]<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: Section {<br>
> > +# CHECK: Name: .hsatext<br>
> > +# CHECK: Type: SHT_PROGBITS<br>
> > +# CHECK: Flags [ (0xC00007)<br>
> > +# CHECK: SHF_ALLOC (0x2)<br>
> > +# CHECK: SHF_AMDGPU_HSA_AGENT (0x800000)<br>
> > +# CHECK: SHF_AMDGPU_HSA_CODE (0x400000)<br>
> > +# CHECK: SHF_EXECINSTR (0x4)<br>
> > +# CHECK: SHF_WRITE (0x1)<br>
> > +# CHECK: ]<br>
> > +# CHECK: Address: [[HSATEXT_ADDR:[0-9xa-f]+]]<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: Symbol {<br>
> > +# CHECK: Name: module_global_agent<br>
> > +# CHECK: Value: 0x0<br>
> > +# CHECK: Size: 4<br>
> > +# CHECK: Binding: Local<br>
> > +# CHECK: Section: .hsadata_global_agent<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: Symbol {<br>
> > +# CHECK: Name: module_global_program<br>
> > +# CHECK: Value: 0x0<br>
> > +# CHECK: Size: 4<br>
> > +# CHECK: Binding: Local<br>
> > +# CHECK: Section: .hsadata_global_program<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: Symbol {<br>
> > +# CHECK: Name: module_global_readonly<br>
> > +# CHECK: Value: 0x0<br>
> > +# CHECK: Size: 4<br>
> > +# CHECK: Binding: Local<br>
> > +# CHECK: Type: Object<br>
> > +# CHECK: Section: .hsatext<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: Symbol {<br>
> > +# CHECK: Name: program_global_agent<br>
> > +# CHECK: Value: 0x4<br>
> > +# CHECK: Size: 4<br>
> > +# CHECK: Binding: Global<br>
> > +# CHECK: Type: Object<br>
> > +# CHECK: Section: .hsadata_global_agent<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: Symbol {<br>
> > +# CHECK: Name: program_global_program<br>
> > +# CHECK: Value: 0x4<br>
> > +# CHECK: Size: 4<br>
> > +# CHECK: Binding: Global<br>
> > +# CHECK: Type: Object<br>
> > +# CHECK: Section: .hsadata_global_program<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: Symbol {<br>
> > +# CHECK: Name: program_global_readonly<br>
> > +# CHECK: Value: 0x4<br>
> > +# CHECK: Size: 4<br>
> > +# CHECK: Binding: Global<br>
> > +# CHECK: Type: Object<br>
> > +# CHECK: Section: .hsatext<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: ProgramHeader {<br>
> > +# CHECK: Type: PT_AMDGPU_HSA_LOAD_GLOBAL_PROGRAM<br>
> > +# CHECK: VirtualAddress: [[HSADATA_GLOBAL_PROGRAM_ADDR]]<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: ProgramHeader {<br>
> > +# CHECK: Type: PT_AMDGPU_HSA_LOAD_CODE_AGENT<br>
> > +# CHECK: VirtualAddress: [[HSATEXT_ADDR]]<br>
> > +# CHECK: }<br>
> ><br>
> > Added: lld/trunk/test/ELF/amdgpu-kernels.s<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/amdgpu-kernels.s?rev=257023&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/amdgpu-kernels.s?rev=257023&view=auto</a><br>
> ><br>
> > ==============================================================================<br>
> > --- lld/trunk/test/ELF/amdgpu-kernels.s (added)<br>
> > +++ lld/trunk/test/ELF/amdgpu-kernels.s Wed Jan 6 21:59:08 2016<br>
> > @@ -0,0 +1,61 @@<br>
> > +# RUN: llvm-mc -filetype=obj -triple=amdgcpu--amdgcn -mcpu=kaveri %s -o<br>
> > %t.o<br>
> > +# RUN: lld -flavor gnu %t.o -o %t<br>
> > +# RUN: llvm-readobj -sections -symbols -program-headers %t | FileCheck %s<br>
> > +<br>
> > +.hsa_code_object_version 1,0<br>
> > +.hsa_code_object_isa 7,0,0,"AMD","AMDGPU"<br>
> > +<br>
> > +.hsatext<br>
> > +.globl kernel0<br>
> > +.align 256<br>
> > +.amdgpu_hsa_kernel kernel0<br>
> > +kernel0:<br>
> > + s_endpgm<br>
> > +.Lfunc_end0:<br>
> > + .size kernel0, .Lfunc_end0-kernel0<br>
> > +<br>
> > +.globl kernel1<br>
> > +.align 256<br>
> > +.amdgpu_hsa_kernel kernel1<br>
> > +kernel1:<br>
> > + s_endpgm<br>
> > + s_endpgm<br>
> > +.Lfunc_end1:<br>
> > + .size kernel1, .Lfunc_end1-kernel1<br>
> > +<br>
> > +<br>
> > +# CHECK: Section {<br>
> > +# CHECK: Name: .hsatext<br>
> > +# CHECK: Type: SHT_PROGBITS<br>
> > +# CHECK: Flags [ (0xC00007)<br>
> > +# CHECK: SHF_ALLOC (0x2)<br>
> > +# CHECK: SHF_AMDGPU_HSA_AGENT (0x800000)<br>
> > +# CHECK: SHF_AMDGPU_HSA_CODE (0x400000)<br>
> > +# CHECK: SHF_EXECINSTR (0x4)<br>
> > +# CHECK: SHF_WRITE (0x1)<br>
> > +# CHECK: ]<br>
> > +# CHECK: Address: [[HSATEXT_ADDR:[0-9xa-f]+]]<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: Symbol {<br>
> > +# CHECK: Name: kernel0<br>
> > +# CHECK: Value: 0x0<br>
> > +# CHECK: Size: 4<br>
> > +# CHECK: Binding: Global<br>
> > +# CHECK: Type: AMDGPU_HSA_KERNEL<br>
> > +# CHECK: Section: .hsatext<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: Symbol {<br>
> > +# CHECK: Name: kernel1<br>
> > +# CHECK: Value: 0x100<br>
> > +# CHECK: Size: 8<br>
> > +# CHECK: Binding: Global<br>
> > +# CHECK: Type: AMDGPU_HSA_KERNEL<br>
> > +# CHECK: Section: .hsatext<br>
> > +# CHECK: }<br>
> > +<br>
> > +# CHECK: ProgramHeader {<br>
> > +# CHECK: Type: PT_AMDGPU_HSA_LOAD_CODE_AGENT<br>
> > +# CHECK: VirtualAddress: [[HSATEXT_ADDR]]<br>
> > +# CHECK: }<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > llvm-commits mailing list<br>
> > <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
> ><br>
<br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br>
</div></div></blockquote></div><br></div>