[all-commits] [llvm/llvm-project] 355264: [AMDGPU] Add AMDGPU support for llvm-objcopy

David Salinas via All-commits all-commits at lists.llvm.org
Thu Aug 6 09:53:56 PDT 2026


  Branch: refs/heads/users/dsalinas/amdgpu-llvm-objcopy
  Home:   https://github.com/llvm/llvm-project
  Commit: 3552648bb33562d60f0ece0e4cbfd8da798ea829
      https://github.com/llvm/llvm-project/commit/3552648bb33562d60f0ece0e4cbfd8da798ea829
  Author: david-salinas <dsalinas at amd.com>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
    M llvm/tools/llvm-objcopy/ObjcopyOptions.cpp

  Log Message:
  -----------
  [AMDGPU] Add AMDGPU support for llvm-objcopy

Co-authored-by: Aakanksha Patil <paakan at amd.com>


  Commit: 4f812a0ea10246b702507c71a2a7005a126ae5c8
      https://github.com/llvm/llvm-project/commit/4f812a0ea10246b702507c71a2a7005a126ae5c8
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test

  Log Message:
  -----------
  [llvm-objcopy] Fix AMDGPU arch string in test: amdgpu not amdgcn

llvm-readobj reports 'Arch: amdgpu' for EM_AMDGPU ELF files
(the generic AMDGPU ELF format used by elf64-amdgpu). The test
was incorrectly expecting 'amdgcn', which is the AMDGCN-specific
arch string used by ROCm HSA code objects.


  Commit: cce72886647dc06a9f52e35c4d75e87fe0fe9384
      https://github.com/llvm/llvm-project/commit/cce72886647dc06a9f52e35c4d75e87fe0fe9384
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test

  Log Message:
  -----------
  [llvm-objcopy] Add AMDGPU case to binary-output-target.test

Add test coverage for converting binary input to elf64-amdgpu format,
verifying the output has the correct format string, arch (amdgpu),
and machine type (EM_AMDGPU 0xE0). Follows the same pattern as all
other architectures in this test file.


  Commit: a1acdc0750ff4eeaffee2c0594e354028fde451c
      https://github.com/llvm/llvm-project/commit/a1acdc0750ff4eeaffee2c0594e354028fde451c
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test

  Log Message:
  -----------
  [llvm-objcopy] Fix AMDGPU arch checks in tests

ELFObjectFile.h getArch() for EM_AMDGPU returns Triple::UnknownArch
when e_flags & EF_AMDGPU_MACH is 0 (no GPU target specified). Only
when a MACH flag in the AMDGCN range is present does it return
Triple::amdgpu.

- cross-arch-headers.test: restore EF_AMDGPU_MACH_AMDGCN_GFX900 flag
  on the input ELF so that after format conversion the output correctly
  reports Arch: amdgpu.

- binary-output-target.test: expect Arch: unknown since converting
  from raw binary input (-I binary) produces an ELF with e_flags=0
  (no MACH flags), giving UnknownArch. This is correct behavior.


  Commit: 7bab7863dbe5b3e2cdb93edeca422d7ef637d533
      https://github.com/llvm/llvm-project/commit/7bab7863dbe5b3e2cdb93edeca422d7ef637d533
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test

  Log Message:
  -----------
  [llvm-objcopy] Address review feedback for AMDGPU test in cross-arch-headers

Per reviewer feedback, use the existing non-AMDGPU input (%t.o, EM_NONE)
to test conversion to elf64-amdgpu. This properly demonstrates that
--output-format changes the machine type, consistent with all other cases
in this test file.

The output reports Arch: unknown because converting from a non-AMDGPU ELF
produces e_flags=0 (no EF_AMDGPU_MACH set); added a comment explaining
this. Flag control is a separate concern for a follow-on PR.


  Commit: 75de22f6f431b5183ffa191135256f9fc22f173d
      https://github.com/llvm/llvm-project/commit/75de22f6f431b5183ffa191135256f9fc22f173d
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
    M llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test

  Log Message:
  -----------
  [llvm-objcopy] Address reviewer feedback on AMDGPU test cleanups

- Remove unused -DMACHINE yaml2obj template variable in cross-arch-headers.test,
  hardcode Machine: EM_NONE directly in the YAML instead
- Remove unused Flags: [[FLAGS=<none>]] template variable in cross-arch-headers.test
- Add comment in binary-output-target.test explaining that Arch: unknown is
  intentional when converting from binary (e_flags=0, no EF_AMDGPU_MACH set)


  Commit: 393e75abe89ef063eed1197609a0bf916a25b5ce
      https://github.com/llvm/llvm-project/commit/393e75abe89ef063eed1197609a0bf916a25b5ce
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M llvm/docs/CommandGuide/llvm-objcopy.rst

  Log Message:
  -----------
  [llvm-objcopy] Add elf64-amdgpu to supported formats in command guide

Update the llvm-objcopy command guide's "Supported formats" section to
include elf64-amdgpu, added in the preceding commit.


Compare: https://github.com/llvm/llvm-project/compare/6e366de96e7b...393e75abe89e

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list