diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-03-16 09:01:54 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2022-03-16 09:01:54 -0400 |
commit | 0c857ef4dfc083b6f5ef2d32182b8db24c5f8d55 (patch) | |
tree | f977a4ae1afb186840ae1492f2dce8f58cd23124 /binutils | |
parent | 2952f10cd79af4645222f124f28c7928287d8113 (diff) | |
download | gdb-0c857ef4dfc083b6f5ef2d32182b8db24c5f8d55.zip gdb-0c857ef4dfc083b6f5ef2d32182b8db24c5f8d55.tar.gz gdb-0c857ef4dfc083b6f5ef2d32182b8db24c5f8d55.tar.bz2 |
binutils/readelf: handle AMDGPU relocation types
Make readelf recognize AMDGPU relocation types, as documented here:
https://llvm.org/docs/AMDGPUUsage.html#amdgpu-relocation-records
The user-visible change looks like:
-000000000004 000400000001 unrecognized: 1 0000000000000000 SCRATCH_RSRC_DWORD0
-00000000000c 000500000001 unrecognized: 1 0000000000000000 SCRATCH_RSRC_DWORD1
-000000000014 000600000007 unrecognized: 7 0000000000000000 global_var0
-00000000001c 000700000008 unrecognized: 8 0000000000000000 global_var1
-000000000024 000800000009 unrecognized: 9 0000000000000000 global_var2
-00000000002c 00090000000a unrecognized: a 0000000000000000 global_var3
-000000000034 000a0000000b unrecognized: b 0000000000000000 global_var4
+000000000004 000400000001 R_AMDGPU_ABS32_LO 0000000000000000 SCRATCH_RSRC_DWORD0
+00000000000c 000500000001 R_AMDGPU_ABS32_LO 0000000000000000 SCRATCH_RSRC_DWORD1
+000000000014 000600000007 R_AMDGPU_GOTPCREL 0000000000000000 global_var0
+00000000001c 000700000008 R_AMDGPU_GOTPCREL 0000000000000000 global_var1
+000000000024 000800000009 R_AMDGPU_GOTPCREL 0000000000000000 global_var2
+00000000002c 00090000000a R_AMDGPU_REL32_LO 0000000000000000 global_var3
+000000000034 000a0000000b R_AMDGPU_REL32_HI 0000000000000000 global_var4
binutils/ChangeLog:
* readelf.c (dump_relocations): Handle EM_AMDGPU.
include/ChangeLog:
* elf/amdgpu.h: Add relocation values.
Change-Id: I2ed4589f4cd37ea11ad2e0cb38d4b682271e1334
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 4 | ||||
-rw-r--r-- | binutils/readelf.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index eb8c197..6d49d8c 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,9 @@ 2022-03-16 Simon Marchi <simon.marchi@efficios.com> + * readelf.c (dump_relocations): Handle EM_AMDGPU. + +2022-03-16 Simon Marchi <simon.marchi@efficios.com> + * Makefile.am (readelf_CFLAGS): New. (readelf_LDADD): Add MSGPACK_LIBS. * Makefile.in: Re-generate. diff --git a/binutils/readelf.c b/binutils/readelf.c index ff07112..a2dbaa4 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -1930,6 +1930,9 @@ dump_relocations (Filedata * filedata, rtype = elf_loongarch_reloc_type (type); break; + case EM_AMDGPU: + rtype = elf_amdgpu_reloc_type (type); + break; } if (rtype == NULL) |