aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binutils/ChangeLog4
-rw-r--r--binutils/readelf.c3
-rw-r--r--include/ChangeLog4
-rw-r--r--include/elf/amdgpu.h21
4 files changed, 32 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)
diff --git a/include/ChangeLog b/include/ChangeLog
index 64aeb12..8219462 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,9 @@
2022-03-16 Simon Marchi <simon.marchi@efficios.com>
+ * elf/amdgpu.h: Add relocation values.
+
+2022-03-16 Simon Marchi <simon.marchi@efficios.com>
+
* elf/amdgcn.h (NT_AMDGPU_METADATA): New.
2022-03-16 Simon Marchi <simon.marchi@efficios.com>
diff --git a/include/elf/amdgpu.h b/include/elf/amdgpu.h
index e3c90dc..140e899 100644
--- a/include/elf/amdgpu.h
+++ b/include/elf/amdgpu.h
@@ -20,6 +20,8 @@
#ifndef _ELF_AMDGPU_H
#define _ELF_AMDGPU_H
+#include "elf/reloc-macros.h"
+
/* e_ident[EI_ABIVERSION] values, when e_ident[EI_OSABI] is
ELFOSABI_AMDGPU_HSA. */
@@ -91,4 +93,23 @@
#define NT_AMDGPU_METADATA 32
+/* Relocations. */
+
+START_RELOC_NUMBERS (elf_amdgpu_reloc_type)
+ RELOC_NUMBER (R_AMDGPU_NONE, 0)
+ RELOC_NUMBER (R_AMDGPU_ABS32_LO, 1)
+ RELOC_NUMBER (R_AMDGPU_ABS32_HI, 2)
+ RELOC_NUMBER (R_AMDGPU_ABS64, 3)
+ RELOC_NUMBER (R_AMDGPU_REL32, 4)
+ RELOC_NUMBER (R_AMDGPU_REL64, 5)
+ RELOC_NUMBER (R_AMDGPU_ABS32, 6)
+ RELOC_NUMBER (R_AMDGPU_GOTPCREL, 7)
+ RELOC_NUMBER (R_AMDGPU_GOTPCREL32_LO, 8)
+ RELOC_NUMBER (R_AMDGPU_GOTPCREL32_HI, 9)
+ RELOC_NUMBER (R_AMDGPU_REL32_LO, 10)
+ RELOC_NUMBER (R_AMDGPU_REL32_HI, 11)
+ RELOC_NUMBER (R_AMDGPU_RELATIVE64, 13)
+ RELOC_NUMBER (R_AMDGPU_REL16, 16)
+END_RELOC_NUMBERS (R_AMDGPU_max)
+
#endif /* _ELF_AMDGPU_H */