Handle "efi-app-riscv64" and similar targets in objcopy.

Message ID 20230906200134.1033297-2-pjones@redhat.com
State Accepted
Headers
Series Handle "efi-app-riscv64" and similar targets in objcopy. |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Peter Jones Sept. 6, 2023, 8:01 p.m. UTC
  This adds the efi target name handling for riscv64 to objcopy.

binutils:
	* binutils/objcopy.c: add riscv64 handling to
	  convert_efi_target()

Signed-off-by: Peter Jones <pjones@redhat.com>
---
 binutils/objcopy.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Palmer Dabbelt Dec. 4, 2023, 5:16 p.m. UTC | #1
On Wed, 06 Sep 2023 13:01:34 PDT (-0700), pjones@redhat.com wrote:
> This adds the efi target name handling for riscv64 to objcopy.
>
> binutils:
> 	* binutils/objcopy.c: add riscv64 handling to
> 	  convert_efi_target()
>
> Signed-off-by: Peter Jones <pjones@redhat.com>
> ---
>  binutils/objcopy.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/binutils/objcopy.c b/binutils/objcopy.c
> index 2ce1b07bf7c..b64cbee3dd7 100644
> --- a/binutils/objcopy.c
> +++ b/binutils/objcopy.c
> @@ -5129,6 +5129,11 @@ convert_efi_target (char **targ)
>        /* Change aarch64 to aarch64-little.  */
>        memcpy (pei + 4 + sizeof ("aarch64") - 1, "-little", sizeof ("-little"));
>      }
> +  else if (strcmp (efi + 4, "riscv64") == 0)
> +    {
> +      /* Change riscv64 to riscv64-little.  */
> +      memcpy (pei + 4 + sizeof ("riscv64") - 1, "-little", sizeof ("-little"));
> +    }
>    *targ = pei;
>    return subsys;
>  }

Sorry I missed this, David just poked me.

Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>

Thanks!
  
Nelson Chu Dec. 5, 2023, 6:45 a.m. UTC | #2
Committed since passed the regressions of riscv-gnu-toolchain.

Thanks
Nelson

On Tue, Dec 5, 2023 at 1:16 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:

> On Wed, 06 Sep 2023 13:01:34 PDT (-0700), pjones@redhat.com wrote:
> > This adds the efi target name handling for riscv64 to objcopy.
> >
> > binutils:
> >       * binutils/objcopy.c: add riscv64 handling to
> >         convert_efi_target()
> >
> > Signed-off-by: Peter Jones <pjones@redhat.com>
> > ---
> >  binutils/objcopy.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/binutils/objcopy.c b/binutils/objcopy.c
> > index 2ce1b07bf7c..b64cbee3dd7 100644
> > --- a/binutils/objcopy.c
> > +++ b/binutils/objcopy.c
> > @@ -5129,6 +5129,11 @@ convert_efi_target (char **targ)
> >        /* Change aarch64 to aarch64-little.  */
> >        memcpy (pei + 4 + sizeof ("aarch64") - 1, "-little", sizeof
> ("-little"));
> >      }
> > +  else if (strcmp (efi + 4, "riscv64") == 0)
> > +    {
> > +      /* Change riscv64 to riscv64-little.  */
> > +      memcpy (pei + 4 + sizeof ("riscv64") - 1, "-little", sizeof
> ("-little"));
> > +    }
> >    *targ = pei;
> >    return subsys;
> >  }
>
> Sorry I missed this, David just poked me.
>
> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
>
> Thanks!
>
  

Patch

diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 2ce1b07bf7c..b64cbee3dd7 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -5129,6 +5129,11 @@  convert_efi_target (char **targ)
       /* Change aarch64 to aarch64-little.  */
       memcpy (pei + 4 + sizeof ("aarch64") - 1, "-little", sizeof ("-little"));
     }
+  else if (strcmp (efi + 4, "riscv64") == 0)
+    {
+      /* Change riscv64 to riscv64-little.  */
+      memcpy (pei + 4 + sizeof ("riscv64") - 1, "-little", sizeof ("-little"));
+    }
   *targ = pei;
   return subsys;
 }