https://sourceware.org/bugzilla/show_bug.cgi?id=33624

            Bug ID: 33624
           Summary: ld (BFD) misses support for the AMD HSA ELF format
           Product: binutils
           Version: 2.43.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

Currently GCC to AMD GCN GPU offload relies on both the llvm assembler and the
lld linker.  readelf knows AMD HSA, an example report from an object file is

ELF Header:
  Magic:   7f 45 4c 46 02 01 01 40 02 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            AMD HSA
  ABI Version:                       2
  Type:                              REL (Relocatable file)
  Machine:                           AMD GPU
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          1792 (bytes into file)
  Flags:                             0x45, gfx1036
  Size of this header:               64 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           64 (bytes)
  Number of section headers:         12
  Section header string table index: 1
...
Relocation section '.rela.text' at offset 0x4f0 contains 8 entries:
  Offset          Info           Type           Sym. Value    Sym. Name +
Addend
0000000000a8  00030000000a R_AMDGPU_REL32_LO 0000000000000000 .data.rel.local +
24
0000000000b0  00030000000b R_AMDGPU_REL32_HI 0000000000000000 .data.rel.local +
24
...
Relocation section '.rela.debug_frame' at offset 0x610 contains 4 entries:
  Offset          Info           Type           Sym. Value    Sym. Name +
Addend
00000000002c  000500000006 R_AMDGPU_ABS32    0000000000000000 .debug_frame + 0
000000000030  000100000003 R_AMDGPU_ABS64    0000000000000000 .text + 0
00000000006c  000500000006 R_AMDGPU_ABS32    0000000000000000 .debug_frame + 0
000000000070  000100000003 R_AMDGPU_ABS64    0000000000000000 .text + 124


but BFD tools report

> objdump -r ../../offload/obj-gcn/gcc/testsuite/gcc/pr66343-1.o 

../../offload/obj-gcn/gcc/testsuite/gcc/pr66343-1.o:     file format
elf64-little

RELOCATION RECORDS FOR [.text]:
OFFSET           TYPE              VALUE
00000000000000a8 UNKNOWN           .data.rel.local+0x0000000000000024
00000000000000b0 UNKNOWN           .data.rel.local+0x0000000000000024
...

and ld support is non-existant.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to