From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A07BC001DF for ; Tue, 25 Jul 2023 21:38:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231174AbjGYViM (ORCPT ); Tue, 25 Jul 2023 17:38:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjGYViK (ORCPT ); Tue, 25 Jul 2023 17:38:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EA251FCF; Tue, 25 Jul 2023 14:38:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E94606186A; Tue, 25 Jul 2023 21:38:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F2CFC433C7; Tue, 25 Jul 2023 21:38:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690321088; bh=iQnUOYEDM9zbdSaZI5cBSuRGjGkw1hFUZD3jQXC38sI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SBzM7oer0Pi+VHosBQgnmCuPvCgtkPbWja2/R+y7xn62/LlA/msmhfYSD+N4+OyP6 pLWfX+zMKhhwfRLHVzl89QjvzeQNbx1Y6in6ALH4epBp/CcP2j0/p3hbV96bL9okf8 /opJOMb391x2aairp78OOjEg2h5UoPIIeCKbxHQKey1FWcoSfeCNHM/LZtpzr3w6Lf 4ZNH2w4wnR5KZaECabTSp7KfBhF67ne9tgx5p1TDG5cWcBcYzrFPdWn7wcH0dRa5qE mIEisYZPEvEpJ+O8HPsvjlI2Q2L+CekAnyGyrRXyTcnoqmbaUrjNrsGp44bNgRbLS+ StlCS/6giwZjA== Date: Tue, 25 Jul 2023 14:38:05 -0700 From: Josh Poimboeuf To: Will Deacon Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , John Stultz , linux-kbuild@vger.kernel.org Subject: Re: [PATCH v2 2/2] scripts/faddr2line: Constrain readelf output to symbols from System.map Message-ID: <20230725213805.g6osfswz5o6cxusy@treble> References: <20230725211157.17031-1-will@kernel.org> <20230725211157.17031-3-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230725211157.17031-3-will@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 25, 2023 at 10:11:57PM +0100, Will Deacon wrote: > @@ -185,7 +186,7 @@ __faddr2line() { > found=2 > break > fi > - done < <(${READELF} --symbols --wide $objfile | sed 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2) > + done < <(${READELF} --symbols --wide $objfile | sed -f ${IGNORED_SYMS} -e 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2) > > if [[ $found = 0 ]]; then > warn "can't find symbol: sym_name: $sym_name sym_sec: $sym_sec sym_addr: $sym_addr sym_elf_size: $sym_elf_size" Looks good, though the outer loop has another readelf incantation: done < <(${READELF} --symbols --wide $objfile | sed 's/\[.*\]//' | ${AWK} -v fn=$sym_name '$4 == "FUNC" && $8 == fn') It should probably have the same sed options? Also it looks like it's wrongly checking for FUNC. -- Josh