All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: fix duplicate definitions for exported symbols
@ 2022-11-02 12:27 Rongwei Zhang
  2022-11-02 19:27 ` Nathan Chancellor
  2022-11-11 15:03 ` Thomas Bogendoerfer
  0 siblings, 2 replies; 3+ messages in thread
From: Rongwei Zhang @ 2022-11-02 12:27 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Ralf Baechle, Maxim Uvarov
  Cc: Nathan Chancellor, Nick Desaulniers, Tom Rix, Rongwei Zhang,
	linux-mips, linux-kernel, llvm

Building with clang-14 fails with:

AS      arch/mips/kernel/relocate_kernel.o
<unknown>:0: error: symbol 'kexec_args' is already defined
<unknown>:0: error: symbol 'secondary_kexec_args' is already defined
<unknown>:0: error: symbol 'kexec_start_address' is already defined
<unknown>:0: error: symbol 'kexec_indirection_page' is already defined
<unknown>:0: error: symbol 'relocate_new_kernel_size' is already defined

It turns out EXPORT defined in asm/asm.h expands to a symbol definition,
so there is no need to define these symbols again. Remove duplicated
symbol definitions.

Fixes: 7aa1c8f47e7e ("MIPS: kdump: Add support")
Signed-off-by: Rongwei Zhang <pudh4418@gmail.com>
---
 arch/mips/kernel/relocate_kernel.S | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/arch/mips/kernel/relocate_kernel.S b/arch/mips/kernel/relocate_kernel.S
index cfde14b48fd8..f5b2ef979b43 100644
--- a/arch/mips/kernel/relocate_kernel.S
+++ b/arch/mips/kernel/relocate_kernel.S
@@ -145,8 +145,7 @@ LEAF(kexec_smp_wait)
  * kexec_args[0..3] are used to prepare register values.
  */
 
-kexec_args:
-	EXPORT(kexec_args)
+EXPORT(kexec_args)
 arg0:	PTR_WD		0x0
 arg1:	PTR_WD		0x0
 arg2:	PTR_WD		0x0
@@ -159,8 +158,7 @@ arg3:	PTR_WD		0x0
  * their registers a0-a3. secondary_kexec_args[0..3] are used
  * to prepare register values.
  */
-secondary_kexec_args:
-	EXPORT(secondary_kexec_args)
+EXPORT(secondary_kexec_args)
 s_arg0: PTR_WD		0x0
 s_arg1: PTR_WD		0x0
 s_arg2: PTR_WD		0x0
@@ -171,19 +169,16 @@ kexec_flag:
 
 #endif
 
-kexec_start_address:
-	EXPORT(kexec_start_address)
+EXPORT(kexec_start_address)
 	PTR_WD		0x0
 	.size		kexec_start_address, PTRSIZE
 
-kexec_indirection_page:
-	EXPORT(kexec_indirection_page)
+EXPORT(kexec_indirection_page)
 	PTR_WD		0
 	.size		kexec_indirection_page, PTRSIZE
 
 relocate_new_kernel_end:
 
-relocate_new_kernel_size:
-	EXPORT(relocate_new_kernel_size)
+EXPORT(relocate_new_kernel_size)
 	PTR_WD		relocate_new_kernel_end - relocate_new_kernel
 	.size		relocate_new_kernel_size, PTRSIZE
-- 
2.38.1


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

* Re: [PATCH] MIPS: fix duplicate definitions for exported symbols
  2022-11-02 12:27 [PATCH] MIPS: fix duplicate definitions for exported symbols Rongwei Zhang
@ 2022-11-02 19:27 ` Nathan Chancellor
  2022-11-11 15:03 ` Thomas Bogendoerfer
  1 sibling, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2022-11-02 19:27 UTC (permalink / raw)
  To: Rongwei Zhang
  Cc: Thomas Bogendoerfer, Ralf Baechle, Maxim Uvarov,
	Nick Desaulniers, Tom Rix, linux-mips, linux-kernel, llvm

On Wed, Nov 02, 2022 at 08:27:39PM +0800, Rongwei Zhang wrote:
> Building with clang-14 fails with:
> 
> AS      arch/mips/kernel/relocate_kernel.o
> <unknown>:0: error: symbol 'kexec_args' is already defined
> <unknown>:0: error: symbol 'secondary_kexec_args' is already defined
> <unknown>:0: error: symbol 'kexec_start_address' is already defined
> <unknown>:0: error: symbol 'kexec_indirection_page' is already defined
> <unknown>:0: error: symbol 'relocate_new_kernel_size' is already defined
> 
> It turns out EXPORT defined in asm/asm.h expands to a symbol definition,
> so there is no need to define these symbols again. Remove duplicated
> symbol definitions.
> 
> Fixes: 7aa1c8f47e7e ("MIPS: kdump: Add support")
> Signed-off-by: Rongwei Zhang <pudh4418@gmail.com>

Indeed. I had a similar diff when I looked into this late last year but
I never got around to sending that diff.

https://github.com/ClangBuiltLinux/linux/issues/1528#issuecomment-988235109

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

Thanks for the patch!

> ---
>  arch/mips/kernel/relocate_kernel.S | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/mips/kernel/relocate_kernel.S b/arch/mips/kernel/relocate_kernel.S
> index cfde14b48fd8..f5b2ef979b43 100644
> --- a/arch/mips/kernel/relocate_kernel.S
> +++ b/arch/mips/kernel/relocate_kernel.S
> @@ -145,8 +145,7 @@ LEAF(kexec_smp_wait)
>   * kexec_args[0..3] are used to prepare register values.
>   */
>  
> -kexec_args:
> -	EXPORT(kexec_args)
> +EXPORT(kexec_args)
>  arg0:	PTR_WD		0x0
>  arg1:	PTR_WD		0x0
>  arg2:	PTR_WD		0x0
> @@ -159,8 +158,7 @@ arg3:	PTR_WD		0x0
>   * their registers a0-a3. secondary_kexec_args[0..3] are used
>   * to prepare register values.
>   */
> -secondary_kexec_args:
> -	EXPORT(secondary_kexec_args)
> +EXPORT(secondary_kexec_args)
>  s_arg0: PTR_WD		0x0
>  s_arg1: PTR_WD		0x0
>  s_arg2: PTR_WD		0x0
> @@ -171,19 +169,16 @@ kexec_flag:
>  
>  #endif
>  
> -kexec_start_address:
> -	EXPORT(kexec_start_address)
> +EXPORT(kexec_start_address)
>  	PTR_WD		0x0
>  	.size		kexec_start_address, PTRSIZE
>  
> -kexec_indirection_page:
> -	EXPORT(kexec_indirection_page)
> +EXPORT(kexec_indirection_page)
>  	PTR_WD		0
>  	.size		kexec_indirection_page, PTRSIZE
>  
>  relocate_new_kernel_end:
>  
> -relocate_new_kernel_size:
> -	EXPORT(relocate_new_kernel_size)
> +EXPORT(relocate_new_kernel_size)
>  	PTR_WD		relocate_new_kernel_end - relocate_new_kernel
>  	.size		relocate_new_kernel_size, PTRSIZE
> -- 
> 2.38.1
> 

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

* Re: [PATCH] MIPS: fix duplicate definitions for exported symbols
  2022-11-02 12:27 [PATCH] MIPS: fix duplicate definitions for exported symbols Rongwei Zhang
  2022-11-02 19:27 ` Nathan Chancellor
@ 2022-11-11 15:03 ` Thomas Bogendoerfer
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2022-11-11 15:03 UTC (permalink / raw)
  To: Rongwei Zhang
  Cc: Ralf Baechle, Maxim Uvarov, Nathan Chancellor, Nick Desaulniers,
	Tom Rix, linux-mips, linux-kernel, llvm

On Wed, Nov 02, 2022 at 08:27:39PM +0800, Rongwei Zhang wrote:
> Building with clang-14 fails with:
> 
> AS      arch/mips/kernel/relocate_kernel.o
> <unknown>:0: error: symbol 'kexec_args' is already defined
> <unknown>:0: error: symbol 'secondary_kexec_args' is already defined
> <unknown>:0: error: symbol 'kexec_start_address' is already defined
> <unknown>:0: error: symbol 'kexec_indirection_page' is already defined
> <unknown>:0: error: symbol 'relocate_new_kernel_size' is already defined
> 
> It turns out EXPORT defined in asm/asm.h expands to a symbol definition,
> so there is no need to define these symbols again. Remove duplicated
> symbol definitions.
> 
> Fixes: 7aa1c8f47e7e ("MIPS: kdump: Add support")
> Signed-off-by: Rongwei Zhang <pudh4418@gmail.com>
> ---
>  arch/mips/kernel/relocate_kernel.S | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)

applied to mips-fixes.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2022-11-11 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 12:27 [PATCH] MIPS: fix duplicate definitions for exported symbols Rongwei Zhang
2022-11-02 19:27 ` Nathan Chancellor
2022-11-11 15:03 ` Thomas Bogendoerfer

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.