public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: kernel-team@android.com, Will Deacon <will@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nicolas Schier <nicolas@fjasle.eu>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	John Stultz <jstultz@google.com>,
	linux-kbuild@vger.kernel.org
Subject: [PATCH v5 1/3] scripts/faddr2line: Don't filter out non-function symbols from readelf
Date: Mon,  2 Oct 2023 17:57:47 +0100	[thread overview]
Message-ID: <20231002165750.1661-2-will@kernel.org> (raw)
In-Reply-To: <20231002165750.1661-1-will@kernel.org>

As Josh points out in 20230724234734.zy67gm674vl3p3wv@treble:

> Problem is, I think the kernel's symbol printing code prints the
> nearest kallsyms symbol, and there are some valid non-FUNC code
> symbols.  For example, syscall_return_via_sysret.

so we shouldn't be considering only 'FUNC'-type symbols in the output
from readelf.

Drop the function symbol type filtering from the faddr2line outer loop.

Cc: John Stultz <jstultz@google.com>
Suggested-by: Josh Poimboeuf <jpoimboe@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20230724234734.zy67gm674vl3p3wv@treble
Signed-off-by: Will Deacon <will@kernel.org>
---
 scripts/faddr2line | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/faddr2line b/scripts/faddr2line
index 0e73aca4f908..a35a420d0f26 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -260,7 +260,7 @@ __faddr2line() {
 
 		DONE=1
 
-	done < <(${READELF} --symbols --wide $objfile | sed 's/\[.*\]//' | ${AWK} -v fn=$sym_name '$4 == "FUNC" && $8 == fn')
+	done < <(${READELF} --symbols --wide $objfile | sed 's/\[.*\]//' | ${AWK} -v fn=$sym_name '$8 == fn')
 }
 
 [[ $# -lt 2 ]] && usage
-- 
2.42.0.582.g8ccd20d70d-goog


  reply	other threads:[~2023-10-02 16:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-02 16:57 [PATCH v5 0/3] Fix 'faddr2line' for LLVM arm64 builds Will Deacon
2023-10-02 16:57 ` Will Deacon [this message]
2023-10-02 16:57 ` [PATCH v5 2/3] scripts/faddr2line: Use LLVM addr2line and readelf if LLVM=1 Will Deacon
2023-10-02 17:00   ` Nick Desaulniers
2023-10-24  8:52   ` [tip: objtool/core] " tip-bot2 for Will Deacon
2023-10-02 16:57 ` [PATCH v5 3/3] scripts/faddr2line: Skip over mapping symbols in output from readelf Will Deacon
2023-10-02 17:02   ` Nick Desaulniers
2023-10-24  0:17   ` Masahiro Yamada
2023-10-24  8:52   ` [tip: objtool/core] " tip-bot2 for Will Deacon
2023-10-23 13:42 ` [PATCH v5 0/3] Fix 'faddr2line' for LLVM arm64 builds Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231002165750.1661-2-will@kernel.org \
    --to=will@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=jstultz@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox