[PATCH 1/2] tools: relocate-rela: Add M68K support
Marek Vasut
marek.vasut at mailbox.org
Sun Aug 27 00:29:08 CEST 2023
On 8/26/23 09:44, Angelo Dureghello wrote:
> Hi Marek,
>
> thanks a lot for the job i should have done.
>
> Tested on real hw:
>
> m5282evb worked out of the box
> mcf54415 not working,
> had a lot of unsupported relocation type for R_68K_JMP_SLOT
> mcf5307 need to fix the hw, will do in short
>
> i had to add this fix:
>
> diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c
> index 2d008c7f60..9722a6291a 100644
> --- a/tools/relocate-rela.c
> +++ b/tools/relocate-rela.c
> @@ -40,6 +40,10 @@
> #define R_68K_GLOB_DAT 20
> #endif
>
> +#ifndef R_68K_JMP_SLOT
> +#define R_68K_JMP_SLOT 21
> +#endif
> +
> #ifndef R_68K_RELATIVE
> #define R_68K_RELATIVE 22
> #endif
> @@ -531,6 +535,9 @@ static bool supported_rela32(Elf32_Rela *rela,
> uint32_t *type)
> case R_68K_RELATIVE:
> debug("R_68K_RELATIVE\n");
> return true;
> + case R_68K_JMP_SLOT:
> + debug("R_68K_JMP_SLOT\n");
> + return true;
> }
> } else {
> switch (*type) {
> @@ -631,8 +638,9 @@ static int rela_elf32(char **argv, FILE *f)
> return 4;
> }
> } else if ((machine == EM_M68K &&
> - (type == R_68K_32 || type ==
> R_68K_GLOB_DAT)) ||
> - (machine == EM_MICROBLAZE &&
> + (type == R_68K_32 || type == R_68K_GLOB_DAT ||
> + type == R_68K_JMP_SLOT)) ||
> + (machine == EM_MICROBLAZE &&
> (type == R_MICROBLAZE_32 ||
> type == R_MICROBLAZE_GLOB_DAT))) {
> /* global symbols read it and add reloc offset */
Wrapped into V2, thanks
More information about the U-Boot
mailing list