All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v 1/1] powerpc/64s: allow for clang's objdump differences
@ 2020-07-24  0:16 Bill Wendling
  2020-07-24 10:48 ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Wendling @ 2020-07-24  0:16 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev, Bill Wendling

Clang's objdump emits slightly different output from GNU's objdump,
causing a list of warnings to be emitted during relocatable builds.
E.g., clang's objdump emits this:

   c000000000000004: 2c 00 00 48  b  0xc000000000000030
   ...
   c000000000005c6c: 10 00 82 40  bf 2, 0xc000000000005c7c

while GNU objdump emits:

   c000000000000004: 2c 00 00 48  b    c000000000000030 <__start+0x30>
   ...
   c000000000005c6c: 10 00 82 40  bne  c000000000005c7c <masked_interrupt+0x3c>

Adjust llvm-objdump's output to remove the extraneous '0x' and convert
'bf' and 'bt' to 'bne' and 'beq' resp. to more closely match GNU
objdump's output.

Note that clang's objdump doesn't yet output the relocation symbols on
PPC.

Signed-off-by: Bill Wendling <morbo@google.com>
---
 arch/powerpc/tools/unrel_branch_check.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/tools/unrel_branch_check.sh b/arch/powerpc/tools/unrel_branch_check.sh
index 77114755dc6f..71ce86b68d18 100755
--- a/arch/powerpc/tools/unrel_branch_check.sh
+++ b/arch/powerpc/tools/unrel_branch_check.sh
@@ -31,6 +31,9 @@ grep -e "^c[0-9a-f]*:[[:space:]]*\([0-9a-f][0-9a-f][[:space:]]\)\{4\}[[:space:]]
 grep -v '\<__start_initialization_multiplatform>' |
 grep -v -e 'b.\?.\?ctr' |
 grep -v -e 'b.\?.\?lr' |
+sed 's/\bbt.\?[[:space:]]*[[:digit:]][[:digit:]]*,/beq/' |
+sed 's/\bbf.\?[[:space:]]*[[:digit:]][[:digit:]]*,/bne/' |
+sed 's/[[:space:]]0x/ /' |
 sed 's/://' |
 awk '{ print $1 ":" $6 ":0x" $7 ":" $8 " "}'
 )

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

* Re: [PATCH v 1/1] powerpc/64s: allow for clang's objdump differences
  2020-07-24  0:16 [PATCH v 1/1] powerpc/64s: allow for clang's objdump differences Bill Wendling
@ 2020-07-24 10:48 ` Michael Ellerman
  2020-07-24 22:40   ` Bill Wendling
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2020-07-24 10:48 UTC (permalink / raw)
  To: Bill Wendling, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev, Bill Wendling

Hi Bill,

Bill Wendling <morbo@google.com> writes:
> Clang's objdump emits slightly different output from GNU's objdump,
> causing a list of warnings to be emitted during relocatable builds.
> E.g., clang's objdump emits this:
>
>    c000000000000004: 2c 00 00 48  b  0xc000000000000030
>    ...
>    c000000000005c6c: 10 00 82 40  bf 2, 0xc000000000005c7c
>
> while GNU objdump emits:
>
>    c000000000000004: 2c 00 00 48  b    c000000000000030 <__start+0x30>
>    ...
>    c000000000005c6c: 10 00 82 40  bne  c000000000005c7c <masked_interrupt+0x3c>
>
> Adjust llvm-objdump's output to remove the extraneous '0x' and convert
> 'bf' and 'bt' to 'bne' and 'beq' resp. to more closely match GNU
> objdump's output.
>
> Note that clang's objdump doesn't yet output the relocation symbols on
> PPC.
>
> Signed-off-by: Bill Wendling <morbo@google.com>
> ---
>  arch/powerpc/tools/unrel_branch_check.sh | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/powerpc/tools/unrel_branch_check.sh b/arch/powerpc/tools/unrel_branch_check.sh
> index 77114755dc6f..71ce86b68d18 100755
> --- a/arch/powerpc/tools/unrel_branch_check.sh
> +++ b/arch/powerpc/tools/unrel_branch_check.sh
> @@ -31,6 +31,9 @@ grep -e "^c[0-9a-f]*:[[:space:]]*\([0-9a-f][0-9a-f][[:space:]]\)\{4\}[[:space:]]
>  grep -v '\<__start_initialization_multiplatform>' |
>  grep -v -e 'b.\?.\?ctr' |
>  grep -v -e 'b.\?.\?lr' |
> +sed 's/\bbt.\?[[:space:]]*[[:digit:]][[:digit:]]*,/beq/' |
> +sed 's/\bbf.\?[[:space:]]*[[:digit:]][[:digit:]]*,/bne/' |
> +sed 's/[[:space:]]0x/ /' |
>  sed 's/://' |

I know you followed the example in the script of just doing everything
as a separate entry in the pipeline, but I think we could consolidate
all the seds into one?

eg:

sed -e 's/\bbt.\?[[:space:]]*[[:digit:]][[:digit:]]*,/beq/' \
    -e 's/\bbf.\?[[:space:]]*[[:digit:]][[:digit:]]*,/bne/' \
    -e 's/[[:space:]]0x/ /' \
    -e 's/://' |

Does that work?

cheers

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

* Re: [PATCH v 1/1] powerpc/64s: allow for clang's objdump differences
  2020-07-24 10:48 ` Michael Ellerman
@ 2020-07-24 22:40   ` Bill Wendling
  2020-07-24 22:49     ` [PATCH v2] " Bill Wendling
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Wendling @ 2020-07-24 22:40 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Paul Mackerras, linuxppc-dev

On Fri, Jul 24, 2020 at 3:48 AM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Hi Bill,
>
> Bill Wendling <morbo@google.com> writes:
> > Clang's objdump emits slightly different output from GNU's objdump,
> > causing a list of warnings to be emitted during relocatable builds.
> > E.g., clang's objdump emits this:
> >
> >    c000000000000004: 2c 00 00 48  b  0xc000000000000030
> >    ...
> >    c000000000005c6c: 10 00 82 40  bf 2, 0xc000000000005c7c
> >
> > while GNU objdump emits:
> >
> >    c000000000000004: 2c 00 00 48  b    c000000000000030 <__start+0x30>
> >    ...
> >    c000000000005c6c: 10 00 82 40  bne  c000000000005c7c <masked_interrupt+0x3c>
> >
> > Adjust llvm-objdump's output to remove the extraneous '0x' and convert
> > 'bf' and 'bt' to 'bne' and 'beq' resp. to more closely match GNU
> > objdump's output.
> >
> > Note that clang's objdump doesn't yet output the relocation symbols on
> > PPC.
> >
> > Signed-off-by: Bill Wendling <morbo@google.com>
> > ---
> >  arch/powerpc/tools/unrel_branch_check.sh | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/powerpc/tools/unrel_branch_check.sh b/arch/powerpc/tools/unrel_branch_check.sh
> > index 77114755dc6f..71ce86b68d18 100755
> > --- a/arch/powerpc/tools/unrel_branch_check.sh
> > +++ b/arch/powerpc/tools/unrel_branch_check.sh
> > @@ -31,6 +31,9 @@ grep -e "^c[0-9a-f]*:[[:space:]]*\([0-9a-f][0-9a-f][[:space:]]\)\{4\}[[:space:]]
> >  grep -v '\<__start_initialization_multiplatform>' |
> >  grep -v -e 'b.\?.\?ctr' |
> >  grep -v -e 'b.\?.\?lr' |
> > +sed 's/\bbt.\?[[:space:]]*[[:digit:]][[:digit:]]*,/beq/' |
> > +sed 's/\bbf.\?[[:space:]]*[[:digit:]][[:digit:]]*,/bne/' |
> > +sed 's/[[:space:]]0x/ /' |
> >  sed 's/://' |
>
> I know you followed the example in the script of just doing everything
> as a separate entry in the pipeline, but I think we could consolidate
> all the seds into one?
>
> eg:
>
> sed -e 's/\bbt.\?[[:space:]]*[[:digit:]][[:digit:]]*,/beq/' \
>     -e 's/\bbf.\?[[:space:]]*[[:digit:]][[:digit:]]*,/bne/' \
>     -e 's/[[:space:]]0x/ /' \
>     -e 's/://' |
>
> Does that work?
>
I'm fine with that. I separated them mostly for my benefit while
creating the patch to keep things simple. :-) I'll send out an update.

-bw

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

* [PATCH v2] powerpc/64s: allow for clang's objdump differences
  2020-07-24 22:40   ` Bill Wendling
@ 2020-07-24 22:49     ` Bill Wendling
  2020-07-27  7:26       ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Wendling @ 2020-07-24 22:49 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev, Bill Wendling

Clang's objdump emits slightly different output from GNU's objdump,
causing a list of warnings to be emitted during relocatable builds.
E.g., clang's objdump emits this:

   c000000000000004: 2c 00 00 48  b  0xc000000000000030
   ...
   c000000000005c6c: 10 00 82 40  bf 2, 0xc000000000005c7c

while GNU objdump emits:

   c000000000000004: 2c 00 00 48  b    c000000000000030 <__start+0x30>
   ...
   c000000000005c6c: 10 00 82 40  bne  c000000000005c7c <masked_interrupt+0x3c>

Adjust llvm-objdump's output to remove the extraneous '0x' and convert
'bf' and 'bt' to 'bne' and 'beq' resp. to more closely match GNU
objdump's output.

Note that clang's objdump doesn't yet output the relocation symbols on
PPC.

Signed-off-by: Bill Wendling <morbo@google.com>
---
 arch/powerpc/tools/unrel_branch_check.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/tools/unrel_branch_check.sh b/arch/powerpc/tools/unrel_branch_check.sh
index 77114755dc6f..6e6a30aea3ed 100755
--- a/arch/powerpc/tools/unrel_branch_check.sh
+++ b/arch/powerpc/tools/unrel_branch_check.sh
@@ -31,7 +31,10 @@ grep -e "^c[0-9a-f]*:[[:space:]]*\([0-9a-f][0-9a-f][[:space:]]\)\{4\}[[:space:]]
 grep -v '\<__start_initialization_multiplatform>' |
 grep -v -e 'b.\?.\?ctr' |
 grep -v -e 'b.\?.\?lr' |
-sed 's/://' |
+sed -e 's/\bbt.\?[[:space:]]*[[:digit:]][[:digit:]]*,/beq/' \
+	-e 's/\bbf.\?[[:space:]]*[[:digit:]][[:digit:]]*,/bne/' \
+	-e 's/[[:space:]]0x/ /' \
+	-e 's/://' |
 awk '{ print $1 ":" $6 ":0x" $7 ":" $8 " "}'
 )
 

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

* Re: [PATCH v2] powerpc/64s: allow for clang's objdump differences
  2020-07-24 22:49     ` [PATCH v2] " Bill Wendling
@ 2020-07-27  7:26       ` Michael Ellerman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2020-07-27  7:26 UTC (permalink / raw)
  To: Michael Ellerman, Bill Wendling, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev

On Fri, 24 Jul 2020 15:49:01 -0700, Bill Wendling wrote:
> Clang's objdump emits slightly different output from GNU's objdump,
> causing a list of warnings to be emitted during relocatable builds.
> E.g., clang's objdump emits this:
> 
>    c000000000000004: 2c 00 00 48  b  0xc000000000000030
>    ...
>    c000000000005c6c: 10 00 82 40  bf 2, 0xc000000000005c7c
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/64s: allow for clang's objdump differences
      https://git.kernel.org/powerpc/c/faedc380129501bdd7f669bf14e9c7ee3e7a2feb

cheers

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

end of thread, other threads:[~2020-07-27  7:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24  0:16 [PATCH v 1/1] powerpc/64s: allow for clang's objdump differences Bill Wendling
2020-07-24 10:48 ` Michael Ellerman
2020-07-24 22:40   ` Bill Wendling
2020-07-24 22:49     ` [PATCH v2] " Bill Wendling
2020-07-27  7:26       ` Michael Ellerman

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.