Allows to test Obj->getArch () == Triple::amdgpu and prints "ELF-amdgpu-hsacobj" on ELF dump.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/llvm/Object/ELFObjectFile.h | ||
---|---|---|
848 ↗ | (On Diff #47656) | Why is the -unknown necessary? Also should this be amdgcn? The other targets look like they are using the regular arch prefix here |
include/llvm/Object/ELFObjectFile.h | ||
---|---|---|
848 ↗ | (On Diff #47656) | Don't have any preference here, let it be amdgcn. HSA Code Object spec has requirement : EF.getHeader()->e_ident[ELF::EI_CLASS] == ELF::EM_AMDGPU all other I consider "unknown" though not sticking on it either. |
include/llvm/Object/ELFObjectFile.h | ||
---|---|---|
848 ↗ | (On Diff #47803) | I would expect the enum name to change. Is this the one standardized somewhere? If we can't change the enum, then I guess the string should match |
include/llvm/Object/ELFObjectFile.h | ||
---|---|---|
848 ↗ | (On Diff #47803) | Well, EM_AMDGPU extensively used and match the name in the HSA Code Object spec so I change name to "ELFxx-amdgpu". |
Two things. This needs tests, and i want to make sure that we use the same file format name as binutils.
Added tests.
Michael, this is the first place we introducing format name, what would make you sure it will be used in binutils? Should it be registered somewhere?
So, is this the same target that has been added to lld?
Before we continue adding support for it in llvm I want to make sure the address X offset issue is resolved.
Please don't.
What is currently being produced by lld is simply not valid elf. We
should not be spreading it before it is fixed.
Cheers,
Rafael
I agree with Rafael. Some fields of the AMDGPU ELF file were defined based on a misunderstanding of the ELF file format. Please please fix it before it's too late.
What's currently implemented now is a 1st draft of the spec.Soon a newer version will be implemented which I'm pretty sure fixes this issue
Can you fix it and then add code to LLVM? Adding code to LLVM allows people
to start creating object files in the odd "ELF" format. If a fix is not
made in a timely manner, it can be too late, and there's a chance that you
will have no choice other than supporting the old broken format.
Can you fix it and then add code to LLVM? Adding code to LLVM allows people
to start creating object files in the odd "ELF" format. If a fix is not
made in a timely manner, it can be too late, and there's a chance that you
will have no choice other than supporting the old broken format.
Is the concern more about custom non-standard code in lld for AMDGPU? We are now actively working on making it more standard.
This change is more about general support in LLVM for EM_AMDGPU and allows us to run llvm-objdump on AMDGPU ELFs to verify changes in disassembler. EM_AMDGPU is officially registered too, see http://www.sco.com/developers/gabi/latest/ch4.eheader.html
Assuming we work on removing non-standard code from lld, is there anything wrong with this change?
No, there's no particular concern regarding this change itself. I wanted to see it being removed until the AMDGPU support becomes generally available. Because the code for the nonstandard part of the ABI is being removed from lld, I'm fine with this change. Thank you for doing this.