Index: lib/ReaderWriter/ELF/AMDGPU/AMDGPUSymbolTable.cpp =================================================================== --- lib/ReaderWriter/ELF/AMDGPU/AMDGPUSymbolTable.cpp +++ lib/ReaderWriter/ELF/AMDGPU/AMDGPUSymbolTable.cpp @@ -22,9 +22,6 @@ int64_t addr) { SymbolTable::addDefinedAtom(sym, da, addr); - // FIXME: Only do this for kernel functions. - sym.setType(STT_AMDGPU_HSA_KERNEL); - // Make st_value section relative. // FIXME: This is hack to give kernel symbols a section relative offset. // Because of this hack only on kernel can be included in a binary file. Index: test/elf/AMDGPU/hsa-symbols.test =================================================================== --- /dev/null +++ test/elf/AMDGPU/hsa-symbols.test @@ -0,0 +1,30 @@ +# RUN: yaml2obj -format=elf %s > %t.obj +# RUN: lld -flavor gnu -target amdgcn--hsa %t.obj -o %t.exe --noinhibit-exec +# RUN: llvm-readobj -h -program-headers -s -symbols %t.exe | FileCheck %s + +# CHECK: Symbol { +# CHECK: Name: global_agent +# CHECK: Binding: Local +# FIXME: Should be Type: Object +# CHECK-NOT: Type: AMDGPU_HSA_KERNEL + +--- +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_GNU + Type: ET_REL + Machine: EM_AMDGPU +Sections: + - Name: .hsadata_global_agent + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_WRITE, SHF_AMDGPU_HSA_GLOBAL, + SHF_AMDGPU_HSA_AGENT ] + AddressAlign: 0x0000000000000004 + Content: '' +Symbols: + Local: + - Name: global_agent + Type: STT_OBJECT + Section: .hsadata_global_agent +...