[PATCH -fixes] riscv: Remove duplicate objcopy flag

Palmer Dabbelt palmer at dabbelt.com
Wed Sep 20 02:52:06 PDT 2023


On Thu, 14 Sep 2023 02:13:34 PDT (-0700), songshuaishuai at tinylab.org wrote:
> There are two duplicate `-O binary` flags when objcopying from vmlinux
> to Image/xipImage.
>
> RISC-V set `-O binary` flag in both OBJCOPYFLAGS in the top-level riscv
> Makefile and OBJCOPYFLAGS_* in the boot/Makefile, and the objcopy cmd
> in Kbuild would join them together.
>
> The `-O binary` flag is only needed for objcopying Image, so remove the
> OBJCOPYFLAGS in the top-level riscv Makefile.
>
> Fixes: c0fbcd991860 ("RISC-V: Build flat and compressed kernel images")
> Signed-off-by: Song Shuai <songshuaishuai at tinylab.org>
> ---
>  arch/riscv/Makefile | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
> index 1329e060c548..b43a6bb7e4dc 100644
> --- a/arch/riscv/Makefile
> +++ b/arch/riscv/Makefile
> @@ -6,7 +6,6 @@
>  # for more details.
>  #
>
> -OBJCOPYFLAGS    := -O binary
>  LDFLAGS_vmlinux := -z norelro
>  ifeq ($(CONFIG_RELOCATABLE),y)
>  	LDFLAGS_vmlinux += -shared -Bsymbolic -z notext --emit-relocs

Does this result in any incorrect behavior?  It looks fine to me, but if 
there's no regression I'll put in on -next instead of -fixes.

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



More information about the linux-riscv mailing list