On 7/27/22 16:34, Mark Kettenis wrote:
The contents of <elf.h> differ between OSes.  It may only define
the relocation types for the host architecture, and may not contain
machine-specific defines for more obscure architectures (such as
Microblaze) at all.

Define the relevant constants for Microblaze locally if they are
not provided by <elf.h>.

Fixes: 034944b33bc8 ("tools: relocate-rela: Add support for 32bit Microblaze 
relocation")
Signed-off-by: Mark Kettenis <kette...@openbsd.org>
---
  tools/relocate-rela.c | 20 ++++++++++++++++++++
  1 file changed, 20 insertions(+)

diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c
index 090fb1acb2..c57c3cfade 100644
--- a/tools/relocate-rela.c
+++ b/tools/relocate-rela.c
@@ -20,6 +20,26 @@
  #define R_AARCH64_RELATIVE    1027
  #endif
+#ifndef EM_MICROBLAZE
+#define EM_MICROBLAZE          189
+#endif
+
+#ifndef R_MICROBLAZE_NONE
+#define R_MICROBLAZE_NONE      0
+#endif
+
+#ifndef R_MICROBLAZE_32
+#define R_MICROBLAZE_32                1
+#endif
+
+#ifndef R_MICROBLAZE_REL
+#define R_MICROBLAZE_REL       16
+#endif
+
+#ifndef R_MICROBLAZE_GLOB_DAT
+#define R_MICROBLAZE_GLOB_DAT  18
+#endif
+
  static int ei_class;
static uint64_t rela_start, rela_end, text_base, dyn_start;


It is fixed already in the latest master branch. Tom merged it yesterday.
Please take a look.

Thanks,
Michal

Reply via email to