This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Add ELFOSABI_AMDGPU_PAL
ClosedPublic

Authored by kzhuravl on Sep 28 2017, 3:53 PM.

Details

Reviewers
t-tye
tpr
Summary

Docs by @tpr

Diff Detail

Event Timeline

kzhuravl created this revision.Sep 28 2017, 3:53 PM
t-tye added inline comments.Sep 28 2017, 9:03 PM
include/llvm/Object/ELFObjectFile.h
1067–1073

Perhaps this should be:

if (EF.getHeader()->e_ident[ELF::EI_CLASS] != ELF::ELFCLASS64)
  return Triple::amdgcn;
return Triple::UnknownArch;

The amdgcn only supports 64 bit and is independent of the OS.

tools/llvm-readobj/ELFDumper.cpp
3533–3534

Should this be:

if (e->e_machine == ELF::EM_AMDGPU && (e->e_ident[ELF::EI_OSABI] >= ELF::EI_FIRST_ARCH && e->e_ident[ELF::EI_OSABI] <= ELF::EI_LAST_ARCH))

Since only this range is the architecture specific, and other values should be handled by the ElfOSABI table. Technically there are some entries in that table that are architecture specific and probably ought to be handled in a similar way so that different architectures can use the same values, but if desired that can be done as another patch.

kzhuravl updated this revision to Diff 117184.Sep 29 2017, 10:56 AM
kzhuravl marked an inline comment as done.

Address review feedback.

tools/llvm-readobj/ELFDumper.cpp
3533–3534

Yes, I was planning to do it in separate patch.

t-tye requested changes to this revision.Sep 29 2017, 3:07 PM
t-tye added inline comments.
tools/llvm-readobj/ELFDumper.cpp
3533–3534

Still think should be testing the range of architecture specific codes, and use the general case if outside the range.

This revision now requires changes to proceed.Sep 29 2017, 3:07 PM
kzhuravl added inline comments.Oct 2 2017, 11:42 AM
tools/llvm-readobj/ELFDumper.cpp
3533–3534

This is done in a separate review: D38418.

kzhuravl updated this revision to Diff 117424.Oct 2 2017, 2:40 PM
kzhuravl edited edge metadata.

Rebase.

t-tye requested changes to this revision.Oct 3 2017, 11:31 AM
t-tye added inline comments.
include/llvm/Object/ELFObjectFile.h
1067–1072

Should a TODO be added to suggest adding an e_flags bit to distinguish between the amdgcn and r600 architectures?

1067–1072

Should this also return Triple::UnknownArch if not IsLittleEndian since that is the only supported byte ordering?

This revision now requires changes to proceed.Oct 3 2017, 11:31 AM
kzhuravl updated this revision to Diff 117561.Oct 3 2017, 12:37 PM
kzhuravl edited edge metadata.
kzhuravl marked 2 inline comments as done.

Address review feedback.

t-tye accepted this revision.Oct 3 2017, 12:58 PM

LGTM

This revision is now accepted and ready to land.Oct 3 2017, 12:58 PM
lib/ObjectYAML/ELFYAML.cpp