const OutputSectionBase<ELFT> *OutSec = Section->OutSec;
ESym->st_shndx = OutSec->SectionIndex;
VA = Section->getOffset(*Sym);
-
- // Symbol offsets for AMDGPU are the offsets in bytes of the
- // symbols from the beginning of the section. There seems to be no
- // reason for that deviation -- it's just that the definition of
- // st_value field in AMDGPU's ELF is odd.
- if (Config->EMachine != EM_AMDGPU)
- VA += OutSec->getVA();
+ VA += OutSec->getVA();
}
ESym->st_name = P.second;
ESym->st_size = Sym->st_size;
return D->Sym.st_value;
assert(SC->Live);
- // Symbol offsets for AMDGPU are the offsets in bytes of the symbols
- // from the beginning of the section. Note that this part of AMDGPU's
- // ELF spec is odd and not in line with the standard ELF.
- if (Config->EMachine == EM_AMDGPU)
- return SC->getOffset(D->Sym);
-
if (D->Sym.getType() == STT_TLS)
return SC->OutSec->getVA() + SC->getOffset(D->Sym) -
Out<ELFT>::TlsPhdr->p_vaddr;
return Ret;
}
-/// For AMDGPU we need to use custom segment kinds in order to specify which
-/// address space data should be loaded into.
-template <class ELFT>
-static uint32_t getAmdgpuPhdr(OutputSectionBase<ELFT> *Sec) {
- uint32_t Flags = Sec->getFlags();
- if (Flags & SHF_AMDGPU_HSA_CODE)
- return PT_AMDGPU_HSA_LOAD_CODE_AGENT;
- if ((Flags & SHF_AMDGPU_HSA_GLOBAL) && !(Flags & SHF_AMDGPU_HSA_AGENT))
- return PT_AMDGPU_HSA_LOAD_GLOBAL_PROGRAM;
- return PT_LOAD;
-}
-
// Decide which program headers to create and which sections to include in each
// one.
template <class ELFT> void Writer<ELFT>::createPhdrs() {
// If flags changed then we want new load segment.
uintX_t NewFlags = toPhdrFlags(Sec->getFlags());
if (Flags != NewFlags) {
- uint32_t LoadType = (Config->EMachine == EM_AMDGPU) ? getAmdgpuPhdr(Sec)
- : (uint32_t)PT_LOAD;
- Load = AddHdr(LoadType, NewFlags);
+ Load = AddHdr(PT_LOAD, NewFlags);
Flags = NewFlags;
}
# CHECK: Symbol {
# CHECK: Name: module_global_agent
-# CHECK: Value: 0x0
+# CHECK: Value:
# CHECK: Size: 4
# CHECK: Binding: Local
# CHECK: Section: .hsadata_global_agent
# CHECK: Symbol {
# CHECK: Name: module_global_program
-# CHECK: Value: 0x0
+# CHECK: Value:
# CHECK: Size: 4
# CHECK: Binding: Local
# CHECK: Section: .hsadata_global_program
# CHECK: Symbol {
# CHECK: Name: module_global_readonly
-# CHECK: Value: 0x0
+# CHECK: Value:
# CHECK: Size: 4
# CHECK: Binding: Local
# CHECK: Type: Object
# CHECK: Symbol {
# CHECK: Name: program_global_agent
-# CHECK: Value: 0x4
+# CHECK: Value:
# CHECK: Size: 4
# CHECK: Binding: Global
# CHECK: Type: Object
# CHECK: Symbol {
# CHECK: Name: program_global_program
-# CHECK: Value: 0x4
+# CHECK: Value:
# CHECK: Size: 4
# CHECK: Binding: Global
# CHECK: Type: Object
# CHECK: Symbol {
# CHECK: Name: program_global_readonly
-# CHECK: Value: 0x4
+# CHECK: Value:
# CHECK: Size: 4
# CHECK: Binding: Global
# CHECK: Type: Object
# CHECK: }
# CHECK: ProgramHeader {
-# CHECK: Type: PT_AMDGPU_HSA_LOAD_GLOBAL_PROGRAM
-# CHECK: VirtualAddress: [[HSADATA_GLOBAL_PROGRAM_ADDR]]
+# CHECK: Type: PT_LOAD
+# CHECK: VirtualAddress:
# CHECK: }
# CHECK: ProgramHeader {
-# CHECK: Type: PT_AMDGPU_HSA_LOAD_CODE_AGENT
-# CHECK: VirtualAddress: [[HSATEXT_ADDR]]
+# CHECK: Type: PT_LOAD
+# CHECK: VirtualAddress:
# CHECK: }
# CHECK: Symbol {
# CHECK: Name: kernel0
-# CHECK: Value: 0x0
+# CHECK: Value:
# CHECK: Size: 4
# CHECK: Binding: Global
# CHECK: Type: AMDGPU_HSA_KERNEL
# CHECK: Symbol {
# CHECK: Name: kernel1
-# CHECK: Value: 0x100
+# CHECK: Value:
# CHECK: Size: 8
# CHECK: Binding: Global
# CHECK: Type: AMDGPU_HSA_KERNEL
# CHECK: }
# CHECK: ProgramHeader {
-# CHECK: Type: PT_AMDGPU_HSA_LOAD_CODE_AGENT
-# CHECK: VirtualAddress: [[HSATEXT_ADDR]]
+# CHECK: Type: PT_LOAD
+# CHECK: VirtualAddress:
# CHECK: }