All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] libbpf: fix powerpc check_kabi rule
@ 2020-05-07 14:56 Yauheni Kaliuta
  2020-05-07 14:56 ` [PATCH 1/2] Revert "libbpf: Fix readelf output parsing on powerpc with recent binutils" Yauheni Kaliuta
  2020-05-07 14:56 ` [PATCH 2/2] libbpf: use .so dynamic symbols for abi check Yauheni Kaliuta
  0 siblings, 2 replies; 7+ messages in thread
From: Yauheni Kaliuta @ 2020-05-07 14:56 UTC (permalink / raw)
  To: bpf; +Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko


Yauheni Kaliuta (2):
  Revert "libbpf: Fix readelf output parsing on powerpc with recent
    binutils"
  libbpf: use .so dynamic symbols for abi check

 tools/lib/bpf/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.26.2


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

* [PATCH 1/2] Revert "libbpf: Fix readelf output parsing on powerpc with recent binutils"
  2020-05-07 14:56 [PATCH 0/2] libbpf: fix powerpc check_kabi rule Yauheni Kaliuta
@ 2020-05-07 14:56 ` Yauheni Kaliuta
  2020-05-08 21:46   ` Andrii Nakryiko
  2020-05-07 14:56 ` [PATCH 2/2] libbpf: use .so dynamic symbols for abi check Yauheni Kaliuta
  1 sibling, 1 reply; 7+ messages in thread
From: Yauheni Kaliuta @ 2020-05-07 14:56 UTC (permalink / raw)
  To: bpf; +Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko

The patch makes it fail on the output when the comment is printed
after the symbol name (RHEL8 powerpc):

400: 000000000000c714   144 FUNC    GLOBAL DEFAULT    1 bpf_object__open_file@LIBBPF_0.0.4         [<localentry>: 8]

But after commit aa915931ac3e ("libbpf: Fix readelf output parsing
for Fedora") it is not needed anymore, the parsing should work in
both cases.

This reverts commit 3464afdf11f9a1e031e7858a05351ceca1792fea.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
---
 tools/lib/bpf/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index aee7f1a83c77..908dac9eb562 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -149,7 +149,7 @@ TAGS_PROG := $(if $(shell which etags 2>/dev/null),etags,ctags)
 GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \
 			   cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \
 			   sed 's/\[.*\]//' | \
-			   awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \
+			   awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}' | \
 			   sort -u | wc -l)
 VERSIONED_SYM_COUNT = $(shell readelf -s --wide $(OUTPUT)libbpf.so | \
 			      grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l)
@@ -216,7 +216,7 @@ check_abi: $(OUTPUT)libbpf.so
 		readelf -s --wide $(BPF_IN_SHARED) |			 \
 		    cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' |	 \
 		    sed 's/\[.*\]//' |					 \
-		    awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'|  \
+		    awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}'|   \
 		    sort -u > $(OUTPUT)libbpf_global_syms.tmp;		 \
 		readelf -s --wide $(OUTPUT)libbpf.so |			 \
 		    grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 |		 \
-- 
2.26.2


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

* [PATCH 2/2] libbpf: use .so dynamic symbols for abi check
  2020-05-07 14:56 [PATCH 0/2] libbpf: fix powerpc check_kabi rule Yauheni Kaliuta
  2020-05-07 14:56 ` [PATCH 1/2] Revert "libbpf: Fix readelf output parsing on powerpc with recent binutils" Yauheni Kaliuta
@ 2020-05-07 14:56 ` Yauheni Kaliuta
  2020-05-08 21:44   ` Andrii Nakryiko
  1 sibling, 1 reply; 7+ messages in thread
From: Yauheni Kaliuta @ 2020-05-07 14:56 UTC (permalink / raw)
  To: bpf; +Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko

Since dynamic symbols are used for dynamic linking it makes sense to
use them (readelf --dyn-syms) for abi check.

Found with some configuration on powerpc where linker puts
local *.plt_call.* symbols into .so.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
---
 tools/lib/bpf/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 908dac9eb562..0c7b06de5633 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -151,7 +151,7 @@ GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \
 			   sed 's/\[.*\]//' | \
 			   awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}' | \
 			   sort -u | wc -l)
-VERSIONED_SYM_COUNT = $(shell readelf -s --wide $(OUTPUT)libbpf.so | \
+VERSIONED_SYM_COUNT = $(shell readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \
 			      grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l)
 
 CMD_TARGETS = $(LIB_TARGET) $(PC_FILE)
@@ -218,7 +218,7 @@ check_abi: $(OUTPUT)libbpf.so
 		    sed 's/\[.*\]//' |					 \
 		    awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}'|   \
 		    sort -u > $(OUTPUT)libbpf_global_syms.tmp;		 \
-		readelf -s --wide $(OUTPUT)libbpf.so |			 \
+		readelf --dyn-syms --wide $(OUTPUT)libbpf.so |		 \
 		    grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 |		 \
 		    sort -u > $(OUTPUT)libbpf_versioned_syms.tmp; 	 \
 		diff -u $(OUTPUT)libbpf_global_syms.tmp			 \
-- 
2.26.2


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

* Re: [PATCH 2/2] libbpf: use .so dynamic symbols for abi check
  2020-05-07 14:56 ` [PATCH 2/2] libbpf: use .so dynamic symbols for abi check Yauheni Kaliuta
@ 2020-05-08 21:44   ` Andrii Nakryiko
  0 siblings, 0 replies; 7+ messages in thread
From: Andrii Nakryiko @ 2020-05-08 21:44 UTC (permalink / raw)
  To: Yauheni Kaliuta; +Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko

On Thu, May 7, 2020 at 7:57 AM Yauheni Kaliuta
<yauheni.kaliuta@redhat.com> wrote:
>
> Since dynamic symbols are used for dynamic linking it makes sense to
> use them (readelf --dyn-syms) for abi check.
>
> Found with some configuration on powerpc where linker puts
> local *.plt_call.* symbols into .so.
>
> Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
> ---

Makes sense, thanks.

Acked-by: Andrii Nakryiko <andriin@fb.com>

>  tools/lib/bpf/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index 908dac9eb562..0c7b06de5633 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -151,7 +151,7 @@ GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \
>                            sed 's/\[.*\]//' | \
>                            awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}' | \
>                            sort -u | wc -l)
> -VERSIONED_SYM_COUNT = $(shell readelf -s --wide $(OUTPUT)libbpf.so | \
> +VERSIONED_SYM_COUNT = $(shell readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \
>                               grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l)
>
>  CMD_TARGETS = $(LIB_TARGET) $(PC_FILE)
> @@ -218,7 +218,7 @@ check_abi: $(OUTPUT)libbpf.so
>                     sed 's/\[.*\]//' |                                   \
>                     awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}'|   \
>                     sort -u > $(OUTPUT)libbpf_global_syms.tmp;           \
> -               readelf -s --wide $(OUTPUT)libbpf.so |                   \
> +               readelf --dyn-syms --wide $(OUTPUT)libbpf.so |           \
>                     grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 |             \
>                     sort -u > $(OUTPUT)libbpf_versioned_syms.tmp;        \
>                 diff -u $(OUTPUT)libbpf_global_syms.tmp                  \
> --
> 2.26.2
>

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

* Re: [PATCH 1/2] Revert "libbpf: Fix readelf output parsing on powerpc with recent binutils"
  2020-05-07 14:56 ` [PATCH 1/2] Revert "libbpf: Fix readelf output parsing on powerpc with recent binutils" Yauheni Kaliuta
@ 2020-05-08 21:46   ` Andrii Nakryiko
  2020-05-08 22:18     ` Thadeu Lima de Souza Cascardo
  0 siblings, 1 reply; 7+ messages in thread
From: Andrii Nakryiko @ 2020-05-08 21:46 UTC (permalink / raw)
  To: Yauheni Kaliuta, Justin Forbes, Thadeu Lima de Souza Cascardo,
	Aurelien Jarno
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko

On Thu, May 7, 2020 at 7:57 AM Yauheni Kaliuta
<yauheni.kaliuta@redhat.com> wrote:
>
> The patch makes it fail on the output when the comment is printed
> after the symbol name (RHEL8 powerpc):
>
> 400: 000000000000c714   144 FUNC    GLOBAL DEFAULT    1 bpf_object__open_file@LIBBPF_0.0.4         [<localentry>: 8]
>
> But after commit aa915931ac3e ("libbpf: Fix readelf output parsing
> for Fedora") it is not needed anymore, the parsing should work in
> both cases.
>
> This reverts commit 3464afdf11f9a1e031e7858a05351ceca1792fea.
>
> Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
> ---

Looks good, though would be nice to have people originally involved in
those fixes you mentioned to confirm it works fine still. Added them
to cc.

If no one shouts loudly in next few days:

Acked-by: Andrii Nakryiko <andriin@fb.com>


>  tools/lib/bpf/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index aee7f1a83c77..908dac9eb562 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -149,7 +149,7 @@ TAGS_PROG := $(if $(shell which etags 2>/dev/null),etags,ctags)
>  GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \
>                            cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \
>                            sed 's/\[.*\]//' | \
> -                          awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \
> +                          awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}' | \
>                            sort -u | wc -l)
>  VERSIONED_SYM_COUNT = $(shell readelf -s --wide $(OUTPUT)libbpf.so | \
>                               grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l)
> @@ -216,7 +216,7 @@ check_abi: $(OUTPUT)libbpf.so
>                 readelf -s --wide $(BPF_IN_SHARED) |                     \
>                     cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' |   \
>                     sed 's/\[.*\]//' |                                   \
> -                   awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'|  \
> +                   awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}'|   \
>                     sort -u > $(OUTPUT)libbpf_global_syms.tmp;           \
>                 readelf -s --wide $(OUTPUT)libbpf.so |                   \
>                     grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 |             \
> --
> 2.26.2
>

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

* Re: [PATCH 1/2] Revert "libbpf: Fix readelf output parsing on powerpc with recent binutils"
  2020-05-08 21:46   ` Andrii Nakryiko
@ 2020-05-08 22:18     ` Thadeu Lima de Souza Cascardo
  2020-05-09  6:17       ` Yauheni Kaliuta
  0 siblings, 1 reply; 7+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2020-05-08 22:18 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: Yauheni Kaliuta, Justin Forbes, Aurelien Jarno, bpf,
	Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko

On Fri, May 08, 2020 at 02:46:56PM -0700, Andrii Nakryiko wrote:
> On Thu, May 7, 2020 at 7:57 AM Yauheni Kaliuta
> <yauheni.kaliuta@redhat.com> wrote:
> >
> > The patch makes it fail on the output when the comment is printed
> > after the symbol name (RHEL8 powerpc):
> >
> > 400: 000000000000c714   144 FUNC    GLOBAL DEFAULT    1 bpf_object__open_file@LIBBPF_0.0.4         [<localentry>: 8]
> >
> > But after commit aa915931ac3e ("libbpf: Fix readelf output parsing
> > for Fedora") it is not needed anymore, the parsing should work in
> > both cases.
> >

If it's working either way after aa915931ac3e, is there any specific reason
for the revert?

Cascardo.

> > This reverts commit 3464afdf11f9a1e031e7858a05351ceca1792fea.
> >
> > Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
> > ---
> 
> Looks good, though would be nice to have people originally involved in
> those fixes you mentioned to confirm it works fine still. Added them
> to cc.
> 
> If no one shouts loudly in next few days:
> 
> Acked-by: Andrii Nakryiko <andriin@fb.com>
> 
> 
> >  tools/lib/bpf/Makefile | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> > index aee7f1a83c77..908dac9eb562 100644
> > --- a/tools/lib/bpf/Makefile
> > +++ b/tools/lib/bpf/Makefile
> > @@ -149,7 +149,7 @@ TAGS_PROG := $(if $(shell which etags 2>/dev/null),etags,ctags)
> >  GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \
> >                            cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \
> >                            sed 's/\[.*\]//' | \
> > -                          awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \
> > +                          awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}' | \
> >                            sort -u | wc -l)
> >  VERSIONED_SYM_COUNT = $(shell readelf -s --wide $(OUTPUT)libbpf.so | \
> >                               grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l)
> > @@ -216,7 +216,7 @@ check_abi: $(OUTPUT)libbpf.so
> >                 readelf -s --wide $(BPF_IN_SHARED) |                     \
> >                     cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' |   \
> >                     sed 's/\[.*\]//' |                                   \
> > -                   awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'|  \
> > +                   awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}'|   \
> >                     sort -u > $(OUTPUT)libbpf_global_syms.tmp;           \
> >                 readelf -s --wide $(OUTPUT)libbpf.so |                   \
> >                     grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 |             \
> > --
> > 2.26.2
> >

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

* Re: [PATCH 1/2] Revert "libbpf: Fix readelf output parsing on powerpc with recent binutils"
  2020-05-08 22:18     ` Thadeu Lima de Souza Cascardo
@ 2020-05-09  6:17       ` Yauheni Kaliuta
  0 siblings, 0 replies; 7+ messages in thread
From: Yauheni Kaliuta @ 2020-05-09  6:17 UTC (permalink / raw)
  To: Thadeu Lima de Souza Cascardo
  Cc: Andrii Nakryiko, Justin Forbes, Aurelien Jarno, bpf,
	Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko

Hi, Thadeu!

>>>>> On Fri, 8 May 2020 19:18:35 -0300, Thadeu Lima de Souza Cascardo  wrote:

 > On Fri, May 08, 2020 at 02:46:56PM -0700, Andrii Nakryiko wrote:
 >> On Thu, May 7, 2020 at 7:57 AM Yauheni Kaliuta
 >> <yauheni.kaliuta@redhat.com> wrote:
 >> >
 >> > The patch makes it fail on the output when the comment is printed
 >> > after the symbol name (RHEL8 powerpc):
 >> >
 >> > 400: 000000000000c714 144 FUNC GLOBAL DEFAULT 1
 >> > bpf_object__open_file@LIBBPF_0.0.4 [<localentry>: 8]
 >> >
 >> > But after commit aa915931ac3e ("libbpf: Fix readelf output parsing
 >> > for Fedora") it is not needed anymore, the parsing should work in
 >> > both cases.
 >> >

 > If it's working either way after aa915931ac3e, is there any
 > specific reason for the revert?

 Well, not really, agree.

 > Cascardo.

 >> > This reverts commit 3464afdf11f9a1e031e7858a05351ceca1792fea.
 >> >
 >> > Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
 >> > ---
 >> 
 >> Looks good, though would be nice to have people originally involved in
 >> those fixes you mentioned to confirm it works fine still. Added them
 >> to cc.
 >> 
 >> If no one shouts loudly in next few days:
 >> 
 >> Acked-by: Andrii Nakryiko <andriin@fb.com>
 >> 
 >> 
 >> >  tools/lib/bpf/Makefile | 4 ++--
 >> >  1 file changed, 2 insertions(+), 2 deletions(-)
 >> >
 >> > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
 >> > index aee7f1a83c77..908dac9eb562 100644
 >> > --- a/tools/lib/bpf/Makefile
 >> > +++ b/tools/lib/bpf/Makefile
 >> > @@ -149,7 +149,7 @@ TAGS_PROG := $(if $(shell which etags 2>/dev/null),etags,ctags)
 >> >  GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \
 >> >                            cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \
 >> >                            sed 's/\[.*\]//' | \
 >> > -                          awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \
 >> > +                          awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}' | \
 >> >                            sort -u | wc -l)
 >> >  VERSIONED_SYM_COUNT = $(shell readelf -s --wide $(OUTPUT)libbpf.so | \
 >> >                               grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l)
 >> > @@ -216,7 +216,7 @@ check_abi: $(OUTPUT)libbpf.so
 >> >                 readelf -s --wide $(BPF_IN_SHARED) |                     \
 >> >                     cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' |   \
 >> >                     sed 's/\[.*\]//' |                                   \
 >> > -                   awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'|  \
 >> > +                   awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}'|   \
 >> >                     sort -u > $(OUTPUT)libbpf_global_syms.tmp;           \
 >> >                 readelf -s --wide $(OUTPUT)libbpf.so |                   \
 >> >                     grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 |             \
 >> > --
 >> > 2.26.2
 >> >


-- 
WBR,
Yauheni Kaliuta


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

end of thread, other threads:[~2020-05-09  6:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 14:56 [PATCH 0/2] libbpf: fix powerpc check_kabi rule Yauheni Kaliuta
2020-05-07 14:56 ` [PATCH 1/2] Revert "libbpf: Fix readelf output parsing on powerpc with recent binutils" Yauheni Kaliuta
2020-05-08 21:46   ` Andrii Nakryiko
2020-05-08 22:18     ` Thadeu Lima de Souza Cascardo
2020-05-09  6:17       ` Yauheni Kaliuta
2020-05-07 14:56 ` [PATCH 2/2] libbpf: use .so dynamic symbols for abi check Yauheni Kaliuta
2020-05-08 21:44   ` Andrii Nakryiko

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.