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

David Salinas via All-commits all-commits at lists.llvm.org
Tue Jul 28 10:20:15 PDT 2026


  Branch: refs/heads/users/dsalinas/amdgpu-llvm-objcopy
  Home:   https://github.com/llvm/llvm-project
  Commit: dd0e0238820b990fc1ad20be75302b17d8356c88
      https://github.com/llvm/llvm-project/commit/dd0e0238820b990fc1ad20be75302b17d8356c88
  Author: david-salinas <dsalinas at amd.com>
  Date:   2026-07-28 (Tue, 28 Jul 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: 88253a44b3bad32be955615b8655f4aa3dfb66d4
      https://github.com/llvm/llvm-project/commit/88253a44b3bad32be955615b8655f4aa3dfb66d4
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-07-28 (Tue, 28 Jul 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: 2ddb8328f343f69ad8582fae8d684ef5f2fdc9cb
      https://github.com/llvm/llvm-project/commit/2ddb8328f343f69ad8582fae8d684ef5f2fdc9cb
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-07-28 (Tue, 28 Jul 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: c082d45bd141a6485b6fcbdeff72fdf7d3d88bfa
      https://github.com/llvm/llvm-project/commit/c082d45bd141a6485b6fcbdeff72fdf7d3d88bfa
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-07-28 (Tue, 28 Jul 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: b55886f3adfebf096b5fbbc6dae6b279f1592b15
      https://github.com/llvm/llvm-project/commit/b55886f3adfebf096b5fbbc6dae6b279f1592b15
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-07-28 (Tue, 28 Jul 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.


Compare: https://github.com/llvm/llvm-project/compare/d111119cc007...b55886f3adfe

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