[PATCH] objtool: remove duplicate case value R_PPC64_REL32

Kexy Biscuit posted 1 patch 12 months ago
tools/objtool/arch/powerpc/decode.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] objtool: remove duplicate case value R_PPC64_REL32
Posted by Kexy Biscuit 12 months ago
In arch/powerpc/include/uapi/asm/elf.h, R_PPC64_REL32 is defined as a
macro to R_PPC_REL32, makes the case value here being duplicate and
creates the following error...

arch/powerpc/decode.c: In function ‘arch_reloc_size’:
arch/powerpc/decode.c:114:9: error: duplicate case value
  114 |         case R_PPC64_REL32:
      |         ^~~~
arch/powerpc/decode.c:113:9: note: previously used here
  113 |         case R_PPC_REL32:
      |         ^~~~

Remove the duplicate case value to fix the error.

Fixes: "FROMLIST: objtool: Handle different entry size of rodata"
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
---
This patch is required for this series to build on powerpc, however I'm
not sure if it's the preferred way... Please advise.

 tools/objtool/arch/powerpc/decode.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/objtool/arch/powerpc/decode.c b/tools/objtool/arch/powerpc/decode.c
index 3c95dd74fca0..7c0bf2429067 100644
--- a/tools/objtool/arch/powerpc/decode.c
+++ b/tools/objtool/arch/powerpc/decode.c
@@ -111,7 +111,6 @@ unsigned int arch_reloc_size(struct reloc *reloc)
 {
 	switch (reloc_type(reloc)) {
 	case R_PPC_REL32:
-	case R_PPC64_REL32:
 	case R_PPC_ADDR32:
 	case R_PPC_UADDR32:
 	case R_PPC_PLT32:
-- 
2.48.1

Re: [PATCH] objtool: remove duplicate case value R_PPC64_REL32
Posted by Josh Poimboeuf 12 months ago
On Tue, Feb 11, 2025 at 10:19:57PM +0800, Kexy Biscuit wrote:
> In arch/powerpc/include/uapi/asm/elf.h, R_PPC64_REL32 is defined as a
> macro to R_PPC_REL32, makes the case value here being duplicate and
> creates the following error...
> 
> arch/powerpc/decode.c: In function ‘arch_reloc_size’:
> arch/powerpc/decode.c:114:9: error: duplicate case value
>   114 |         case R_PPC64_REL32:
>       |         ^~~~
> arch/powerpc/decode.c:113:9: note: previously used here
>   113 |         case R_PPC_REL32:
>       |         ^~~~
> 
> Remove the duplicate case value to fix the error.
> 
> Fixes: "FROMLIST: objtool: Handle different entry size of rodata"
> Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
> ---
> This patch is required for this series to build on powerpc, however I'm
> not sure if it's the preferred way... Please advise.

If there are no objections, I'll squash this into the original patch to
avoid breaking bisection.

-- 
Josh