[PATCH 2/4] kbuild: vdso_install: hide readelf warnings

Thomas Weißschuh posted 4 patches 2 weeks ago
There is a newer version of this series
[PATCH 2/4] kbuild: vdso_install: hide readelf warnings
Posted by Thomas Weißschuh 2 weeks ago
If 'readelf -n' encounters a note it does not recognize it emits a
warning. This for example happen when inspecting a compat vDSO for
which the main kernel toolchain was not used.
However the relevant build ID note is always readable, so the
warnings are pointless.

Hide the warnings to make it possible to extrace build IDs for more
architectures in the future.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 scripts/Makefile.vdsoinst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.vdsoinst b/scripts/Makefile.vdsoinst
index 214c561651cf..aed153b3120b 100644
--- a/scripts/Makefile.vdsoinst
+++ b/scripts/Makefile.vdsoinst
@@ -21,7 +21,7 @@ $$(dest): $(1) FORCE
 
 # Some architectures create .build-id symlinks
 ifneq ($(filter arm s390 sparc x86, $(SRCARCH)),)
-build-id-file := $$(shell $(READELF) -n $(1) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
+build-id-file := $$(shell $(READELF) -n $(1) 2>/dev/null | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
 link := $(install-dir)/.build-id/$$(build-id-file).debug
 
 __default: $$(link)

-- 
2.53.0

Re: [PATCH 2/4] kbuild: vdso_install: hide readelf warnings
Posted by Nicolas Schier 3 days, 13 hours ago
On Fri, 20 Mar 2026 17:36:54 +0100, Thomas Weißschuh <linux@weissschuh.net> wrote:
> If 'readelf -n' encounters a note it does not recognize it emits a

,

> warning. This for example happen when inspecting a compat vDSO for

happen -> happens

> which the main kernel toolchain was not used.
> However the relevant build ID note is always readable, so the
> warnings are pointless.
> 
> Hide the warnings to make it possible to extrace build IDs for more

extrace -> extract

>
>
> diff --git a/scripts/Makefile.vdsoinst b/scripts/Makefile.vdsoinst
> index 214c561651cf..aed153b3120b 100644
> --- a/scripts/Makefile.vdsoinst
> +++ b/scripts/Makefile.vdsoinst
> @@ -21,7 +21,7 @@ $$(dest): $(1) FORCE
>  
>  # Some architectures create .build-id symlinks
>  ifneq ($(filter arm s390 sparc x86, $(SRCARCH)),)
> -build-id-file := $$(shell $(READELF) -n $(1) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
> +build-id-file := $$(shell $(READELF) -n $(1) 2>/dev/null | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
>  link := $(install-dir)/.build-id/$$(build-id-file).debug
>  
>  __default: $$(link)

Sound reasonable and the diff looks appropriate.  Thanks!

Reviewed-by: Nicolas Schier <nsc@kernel.org>

-- 
Nicolas