[llvm] [AMDGPU] Add AMDGPU support for llvm-objcopy (PR #92066)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 4 02:02:58 PDT 2025
jh7370 wrote:
> > Hi, Would it be okay to add -DELF_FLAGS to the yaml2obj invocations, it will be set to "" for every command invocation, except for AMDGPU, where we set it to EF_AMDGPU_MACH_AMDGCN_GFX900?
>
> I think that works, @jh7370 ?
Functionally, it works, but I'd still prefer a yaml2obj enhancement to accept the "<none>" value for flags, as with other fields, as it will be cleaner in the test. I experimented with this and the change required is simple. Essentially, in the YAML code, you just need to make the header flags field optional and remove the default value from the `mapOptional` call that otherwise sets it. Then, when the value is used, you assign it a default value (of 0), if the optional field is unset. https://github.com/llvm/llvm-project/commit/2bfaf19516d6eb7fb94b736b091149952bae00f3 is an example of how this was done for the Link field in sections.
https://github.com/llvm/llvm-project/pull/92066
More information about the llvm-commits
mailing list