From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796254048; b=GJGQIJcePpuyMktzUSS7945CPVsk/E0Fdx57ruxnxP8AZIiu8YyIA+NUSJWVn9FjA8nu l6ep3CVntI8TCiHLmHUmtXUo6A1MgLH8HgeiDr5xJz8ym3dPZjg/CXMbz0Puc+6Tvh05O Xt6DBMYcP9bTg+e23SW96j4Jn4nsOkqq5MQN1M6uJ+5wcA1wo5phqa+tBjrARE2/emIcJ ybETLV4DvU96Z2MZSvcZTkmu13ZNBDLFwbgL98n17yB+mbyMP4Imv/U1UXhgcorLb8LZ9 wPKZW8mqm49moTWDMjCYG04+JsqkWv0ueGeK2bCoJnLfH+kpv8OqOiJVRo2NTywDzHA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796254048; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=Ma7XwUsmribMOWe0U1Xk+HaKIhArZ6drRxMjifOSSOY=; b=4/t+TA0uiSONde0CKjm3Fd2AwxKzC9yTuoYObrN153RHyoUQiNkH+8nPD0rvM4Cyfgrl 69XrOmpvyF73uNtnCe6NjdDRT7QWAo0tysCcGJV5TF13OMIyDwo8YCLQpcDmcELWvaz0O o11leD4j70MxaiE6NaD25rXiwGOGl9c9dCEON+iKxB2ubOaJ7VOUdh2gANBGYNNhrzEBb 5s6h4Xf44B0LwUqITl8AhSx79HO7AAeenS9GFkQhyVqIynl4ZRHID3jq18doKTTiyGRvw qTOwT85Ay61UrHJnDOSG/+E+8EWFM0sJqLovEZhLCWj7Uvc29A8TSpUj70QIOFLSGcQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CAt7UODA; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE318606A322 for ; Wed, 2 Dec 2026 23:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CAt7UODA Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC5AD1F0089A; Wed, 2 Dec 2026 23:27:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796254048; bh=Ma7XwUsmribMOWe0U1Xk+HaKIhArZ6drRxMjifOSSOY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=CAt7UODA9tBcOuO9PJpsVuzqHNuneUbb0M0b1+/aZpLFd+m7vrXVrxG9vqi/EohqS icysIr/uGgRLuChXa8d2yzZI+vfw1K1QNWDXuaDcTvdB4c8+Zgy30Rbp8oytB6W7n2 xRLPYTWMqic0Y5/smru2VtlmibgtX/QkwCLRoPBomPXjZLLfckG1Qx5EMmFU0ejp3s 1JbwBo3OBDpunczM18Mg+Fy1TGE8zROInuNm4z//dY5i7F99ZNjmktZuW95iLFyEjg zRSefHwcaBBO6lVTIfDPpLWdrblzHfWswUK1kZaXYTNuFuXW0Yy15dqLF3/GzxScow 3CePlae1W/Bcw== Date: Wed, 2 Dec 2026 15:27:26 -0800 From: Josh Poimboeuf To: Srikar Dronamraju Cc: Brian Johannesmeyer , Madhavan Srinivasan , linuxppc-dev , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Revert "scripts/faddr2line: Combine three readelf calls into one" Message-ID: References: <20260905012449.3872882-2-srikar@linux.ibm.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Tue, Sep 15, 2026 at 07:45:37AM +0530, Srikar Dronamraju wrote: > The other options are > > 1. to reset sed -o errexit in run_readelf > diff --git a/scripts/faddr2line b/scripts/faddr2line > index 622875396bcf..f1b83913d08c 100755 > --- a/scripts/faddr2line > +++ b/scripts/faddr2line > @@ -116,12 +116,14 @@ run_readelf() { > > ${READELF} --file-header --section-headers --symbols --wide "$objfile" > "$tmpfile" > > + set +o errexit > # This assumes that readelf first prints the file header, then the section headers, then the symbols. > # Note: It seems that GNU readelf does not prefix section headers with the "There are X section headers" > # line when multiple options are given, so let's also match with the "Section Headers:" line. > ELF_FILEHEADER=$(sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/q;p' "$tmpfile") > ELF_SECHEADERS=$(sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/,$p' "$tmpfile" | sed -n '/Symbol table .* contains [0-9]* entries:/q;p') > ELF_SYMS=$(sed -n '/Symbol table .* contains [0-9]* entries:/,$p' "$tmpfile") > + set -o errexit > > rm -f -- "$tmpfile" > } > > > 2. or use || true with sed, so that it doesn't fail. > > diff --git a/scripts/faddr2line b/scripts/faddr2line > index 622875396bcf..6e867b053ac4 100755 > --- a/scripts/faddr2line > +++ b/scripts/faddr2line > @@ -119,9 +119,9 @@ run_readelf() { > # This assumes that readelf first prints the file header, then the section headers, then the symbols. > # Note: It seems that GNU readelf does not prefix section headers with the "There are X section headers" > # line when multiple options are given, so let's also match with the "Section Headers:" line. > - ELF_FILEHEADER=$(sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/q;p' "$tmpfile") > - ELF_SECHEADERS=$(sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/,$p' "$tmpfile" | sed -n '/Symbol table .* contains [0-9]* entries:/q;p') > - ELF_SYMS=$(sed -n '/Symbol table .* contains [0-9]* entries:/,$p' "$tmpfile") > + ELF_FILEHEADER=$(sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/q;p' "$tmpfile" || true) > + ELF_SECHEADERS=$(sed -n '/There are [0-9]* section headers, starting at offset\|Section Headers:/,$p' "$tmpfile" | sed -n '/Symbol table .* contains [0-9]* entries:/q;p' || true) > + ELF_SYMS=$(sed -n '/Symbol table .* contains [0-9]* entries:/,$p' "$tmpfile" || true) > > rm -f -- "$tmpfile" > } > > Note: only the SECHEADERS line needs true but adding true to just that line looks hacky. Hm, do you have SHELLOPTS=pipefail set in your environment? -- Josh