All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: relocate-rela: Don't assume <elf.h> defines Microblaze stuff
@ 2022-07-27 14:34 Mark Kettenis
  2022-07-27 15:59 ` Michal Simek
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2022-07-27 14:34 UTC (permalink / raw)
  To: u-boot; +Cc: Michal Simek, Tom Rini, Mark Kettenis

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 <kettenis@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;
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools: relocate-rela: Don't assume <elf.h> defines Microblaze stuff
  2022-07-27 14:34 [PATCH] tools: relocate-rela: Don't assume <elf.h> defines Microblaze stuff Mark Kettenis
@ 2022-07-27 15:59 ` Michal Simek
  2022-07-27 16:31   ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Simek @ 2022-07-27 15:59 UTC (permalink / raw)
  To: Mark Kettenis, u-boot; +Cc: Tom Rini



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 <kettenis@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools: relocate-rela: Don't assume <elf.h> defines Microblaze stuff
  2022-07-27 15:59 ` Michal Simek
@ 2022-07-27 16:31   ` Mark Kettenis
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Kettenis @ 2022-07-27 16:31 UTC (permalink / raw)
  To: Michal Simek; +Cc: kettenis, u-boot

> Date: Wed, 27 Jul 2022 17:59:02 +0200
> From: Michal Simek <michal.simek@amd.com>
> 
> 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 <kettenis@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.

Ah great, missed that.  Works for me!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-27 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27 14:34 [PATCH] tools: relocate-rela: Don't assume <elf.h> defines Microblaze stuff Mark Kettenis
2022-07-27 15:59 ` Michal Simek
2022-07-27 16:31   ` Mark Kettenis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.