Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp =================================================================== --- llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp +++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp @@ -176,12 +176,14 @@ SetupMachineFunction(MF); + const AMDGPUSubtarget &STM = MF.getSubtarget(); MCContext &Context = getObjFileLowering().getContext(); - MCSectionELF *ConfigSection = - Context.getELFSection(".AMDGPU.config", ELF::SHT_PROGBITS, 0); - OutStreamer->SwitchSection(ConfigSection); + if (!STM.isAmdHsaOS()) { + MCSectionELF *ConfigSection = + Context.getELFSection(".AMDGPU.config", ELF::SHT_PROGBITS, 0); + OutStreamer->SwitchSection(ConfigSection); + } - const AMDGPUSubtarget &STM = MF.getSubtarget(); SIProgramInfo KernelInfo; if (STM.getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS) { getSIProgramInfo(KernelInfo, MF); Index: llvm/trunk/test/CodeGen/AMDGPU/hsa-func.ll =================================================================== --- llvm/trunk/test/CodeGen/AMDGPU/hsa-func.ll +++ llvm/trunk/test/CodeGen/AMDGPU/hsa-func.ll @@ -30,12 +30,11 @@ ; ELF: Type: Function (0x2) ; ELF: } +; HSA: .text ; HSA: .hsa_code_object_version 2,1 ; HSA-CI: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" ; HSA-VI: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU" -; HSA: .text - ; HSA-NOT: .amdgpu_hsa_kernel simple ; HSA: {{^}}simple: ; HSA: .amd_kernel_code_t Index: llvm/trunk/test/CodeGen/AMDGPU/hsa.ll =================================================================== --- llvm/trunk/test/CodeGen/AMDGPU/hsa.ll +++ llvm/trunk/test/CodeGen/AMDGPU/hsa.ll @@ -34,12 +34,12 @@ ; ELF: Type: AMDGPU_HSA_KERNEL (0xA) ; ELF: } +; HSA-NOT: .AMDGPU.config +; HSA: .text ; HSA: .hsa_code_object_version 2,1 ; HSA-CI: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" ; HSA-VI: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU" -; HSA: .text - ; HSA: .amdgpu_hsa_kernel simple ; HSA: {{^}}simple: ; HSA: .amd_kernel_code_t