diff --git a/lld/lib/ReaderWriter/ELF/AMDGPU/AMDGPUTargetHandler.cpp b/lld/lib/ReaderWriter/ELF/AMDGPU/AMDGPUTargetHandler.cpp index c86933f33911..7b52cf58cac2 100644 --- a/lld/lib/ReaderWriter/ELF/AMDGPU/AMDGPUTargetHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/AMDGPU/AMDGPUTargetHandler.cpp @@ -34,7 +34,7 @@ std::unique_ptr AMDGPUTargetHandler::getWriter() { } HSATextSection::HSATextSection(const ELFLinkingContext &ctx) - : AtomSection(ctx, ".text", DefinedAtom::typeCode, 0, 0) { + : AtomSection(ctx, ".hsatext", DefinedAtom::typeCode, 0, 0) { _type = SHT_PROGBITS; _flags = SHF_ALLOC | SHF_WRITE | SHF_EXECINSTR | SHF_AMDGPU_HSA_AGENT | SHF_AMDGPU_HSA_CODE; @@ -49,7 +49,7 @@ void AMDGPUTargetLayout::assignSectionsToSegments() { for (OutputSection *osi : _outputSections) { for (Section *section : osi->sections()) { StringRef InputSectionName = section->inputSectionName(); - if (InputSectionName != ".text") + if (InputSectionName != ".hsatext") continue; Segment *segment = new (_allocator) Segment( diff --git a/lld/lib/ReaderWriter/ELF/AMDGPU/AMDGPUTargetHandler.h b/lld/lib/ReaderWriter/ELF/AMDGPU/AMDGPUTargetHandler.h index a944ef054324..8d0f70b6e7f7 100644 --- a/lld/lib/ReaderWriter/ELF/AMDGPU/AMDGPUTargetHandler.h +++ b/lld/lib/ReaderWriter/ELF/AMDGPU/AMDGPUTargetHandler.h @@ -36,7 +36,7 @@ public: createSection(StringRef name, int32_t contentType, DefinedAtom::ContentPermissions contentPermissions, TargetLayout::SectionOrder sectionOrder) override { - if (name == ".text") + if (name == ".hsatext") return new (_allocator) HSATextSection(_ctx); if (name == ".note") diff --git a/lld/test/elf/AMDGPU/hsa.test b/lld/test/elf/AMDGPU/hsa.test index 89a93365fcb6..ad3bd02ba921 100644 --- a/lld/test/elf/AMDGPU/hsa.test +++ b/lld/test/elf/AMDGPU/hsa.test @@ -10,7 +10,7 @@ # CHECK: Section { -# CHECK: Name: .text +# CHECK: Name: .hsatext # CHECK: Type: SHT_PROGBITS (0x1) # CHECK: Flags [ (0xC00007 # CHECK: SHF_ALLOC (0x2) @@ -36,7 +36,7 @@ FileHeader: Type: ET_REL Machine: EM_AMDGPU Sections: - - Name: .text + - Name: .hsatext Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_EXECINSTR ] AddressAlign: 0x0000000000000004 @@ -49,5 +49,5 @@ Symbols: Local: - Name: kernel Type: STT_GNU_IFUNC - Section: .text + Section: .hsatext ...