From nobody Tue Dec 16 16:38:55 2025 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 C0325C28B2B for ; Fri, 19 Aug 2022 16:38:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353517AbiHSQiN (ORCPT ); Fri, 19 Aug 2022 12:38:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353553AbiHSQg1 (ORCPT ); Fri, 19 Aug 2022 12:36:27 -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 0BE9F122DA8; Fri, 19 Aug 2022 09:07:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6DE21617A5; Fri, 19 Aug 2022 16:07:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C2E5C43147; Fri, 19 Aug 2022 16:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925239; bh=Mt7AGGcZfiDtZCpqwjCJ+SIH9BMtPjFp1JhQA7qDVTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yg7bQUMc5yInDwMRGuxNCQGIW8VJEOjbeqHUaXEE6uSkjAAVtGGJfrQtnQa+cgRGx NtfCVWY3XUH+6DSZQXrs2y7qFXPPZlUKMRSg86jmLQ2L91ay68yXvsarGDRckl9/Wo 1LZs6wjGxHm2ke/+plVvjQnlB80HVIKfXP726OwA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Garry , Josh Poimboeuf , Ingo Molnar , Sasha Levin Subject: [PATCH 5.10 428/545] scripts/faddr2line: Fix vmlinux detection on arm64 Date: Fri, 19 Aug 2022 17:43:18 +0200 Message-Id: <20220819153848.562615132@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Josh Poimboeuf [ Upstream commit b6a5068854cfe372da7dee3224dcf023ed5b00cb ] Since commit dcea997beed6 ("faddr2line: Fix overlapping text section failures, the sequel"), faddr2line is completely broken on arm64. For some reason, on arm64, the vmlinux ELF object file type is ET_DYN rather than ET_EXEC. Check for both when determining whether the object is vmlinux. Modules and vmlinux.o have type ET_REL on all arches. Fixes: dcea997beed6 ("faddr2line: Fix overlapping text section failures, th= e sequel") Reported-by: John Garry Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Tested-by: John Garry Link: https://lore.kernel.org/r/dad1999737471b06d6188ce4cdb11329aa41682c.16= 58426357.git.jpoimboe@kernel.org Signed-off-by: Sasha Levin --- scripts/faddr2line | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/faddr2line b/scripts/faddr2line index 94ed98dd899f..57099687e5e1 100755 --- a/scripts/faddr2line +++ b/scripts/faddr2line @@ -112,7 +112,9 @@ __faddr2line() { # section offsets. local file_type=3D$(${READELF} --file-header $objfile | ${AWK} '$1 =3D=3D "Type:" { print $2; exit }') - [[ $file_type =3D "EXEC" ]] && is_vmlinux=3D1 + if [[ $file_type =3D "EXEC" ]] || [[ $file_type =3D=3D "DYN" ]]; then + is_vmlinux=3D1 + fi =20 # Go through each of the object's symbols which match the func name. # In rare cases there might be duplicates, in which case we print all --=20 2.35.1