Thread (12 messages) 12 messages, 5 authors, 2025-02-25

Re: [RFC PATCH] objtool: Skip unannotated intra-function call warning for bl+mflr pattern

From: Nathan Chancellor <nathan@kernel.org>
Date: 2025-02-24 17:09:26
Also in: lkml, llvm

On Mon, Feb 24, 2025 at 02:19:14PM +0100, Christophe Leroy wrote:
Well, this problem already exists on clang 18 it seems:

00000004 <btext_map>:
   4:   7c 08 02 a6     mflr    r0
   8:   94 21 ff e0     stwu    r1,-32(r1)
   c:   93 c1 00 18     stw     r30,24(r1)
  10:   90 01 00 24     stw     r0,36(r1)
  14:   93 a1 00 14     stw     r29,20(r1)
  18:   48 00 00 05     bl      1c <btext_map+0x18>
  1c:   38 a0 00 00     li      r5,0
  20:   7f c8 02 a6     mflr    r30

While GCC generates:

00000418 <btext_map>:
 418:   94 21 ff e0     stwu    r1,-32(r1)
 41c:   7c 08 02 a6     mflr    r0
 420:   42 9f 00 05     bcl     20,4*cr7+so,424 <btext_map+0xc>
 424:   39 20 00 00     li      r9,0
 428:   93 c1 00 18     stw     r30,24(r1)
 42c:   7f c8 02 a6     mflr    r30

So lets make the kernel tolerate it allthough it should be fixed on clang at
the end.

I can't find any related issue in the clang issues database
(https://github.com/llvm/llvm-project/issues), should we open one ?
Yes please, especially if you happen to have a simplified reproducer
(but no worries if not). I can make sure it gets labeled for the PowerPC
backend folks to take a look at.

Cheers,
Nathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help