Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3084447rwb; Mon, 15 Aug 2022 17:44:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR7INl0N143bFZCvSYzRFDFpNxdWZ+pM75Zxa9w4pfn1qaeuTB1vmog1OX3THMjfwyD1P6Bd X-Received: by 2002:a05:6402:2b8b:b0:43a:5475:f1ae with SMTP id fj11-20020a0564022b8b00b0043a5475f1aemr16552683edb.363.1660610694176; Mon, 15 Aug 2022 17:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610694; cv=none; d=google.com; s=arc-20160816; b=Po/ZzDS/5E6Y0/EL3VoUeza8C4L1p2fo52h5NSatMKTB4OeM56jhwrk5HDr20+nSNP N5zPsq3YcTgCa46nKfFhAABM9Xsl+aocxLEM+Pg97VmIb4+chW02H87vcsu+PpgyuB+3 pnUvK/sWLQZ7+tYxHhxa6Ck/PP4nW8p4PF/Jm4HXOXI+WV5X2Z3/Yp0GRPLSK6Fsf+Hq WOVAuIhrIP7SOdp7RJyYYlcdjaDJWsTK+2gcdfuyqoqcb1XisFV4olVPVRkjRGXH9bZ7 30DKd1DSoWirUzFzwIYypd6sW4eDJNVLO7sGTZu+T2D089dtVCoT1jupoFNLf9mTco+f o8mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eUqRXeM69+CVsd8fTpNQJwSbKFYND7CxRzgCK/SWYtI=; b=rEzSnO/YqsnTSKppBj3YzF7iUbgoUsmd3huWchATJs6OxI9kv/dRBRQKnnJxDLv79O 38lxO/Pe7I3e1Wadv8vB7Kg9MLisrsR8W3B9nEfAi3uSO0nXCqvy0iyJcfc2SLTD5IcG gTMRqP3njXBKVBFQg1BSHvA+tEm6kCAoOAH0heLYfRcE9bhOEniPeXFkQopOFaUNJYyw gXDGygDW2eGaUXrLvvZeO7RyOxa6VRZgY94MHNMzqWO66vOHVoCFGC75rbJD24mD2JDg zz6l5g2M3RMnomh9Go0+25i+GdvOVC7KYdyh4nbEPCXtvzbC+kYKEZAs9sjxKyFoGluX se2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VqZvtZgD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v13-20020a056402348d00b0043e85391923si10210165edc.55.2022.08.15.17.44.29; Mon, 15 Aug 2022 17:44:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VqZvtZgD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352632AbiHOXAp (ORCPT + 99 others); Mon, 15 Aug 2022 19:00:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245438AbiHOW6x (ORCPT ); Mon, 15 Aug 2022 18:58:53 -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 DE75E46DAA; Mon, 15 Aug 2022 12:57:05 -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 7BD76612A4; Mon, 15 Aug 2022 19:57:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 699F3C433C1; Mon, 15 Aug 2022 19:57:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593424; bh=Mt7AGGcZfiDtZCpqwjCJ+SIH9BMtPjFp1JhQA7qDVTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VqZvtZgDelkAtKmEH9wBRNm6W4CETkCeK06SIhKwARIlBuHPUHadGTn4xcICdoG41 nVpU3YmPjdKQQRNQ/3m0LjBUq+X8O+mOk1WR9ZI0y+IK2E6OoAH/Jp+EuiiVcrAh6P mzaPJ/HMZA7SB5yY4QVM58brT9rDp5SP5n6gXIGI= 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.18 0944/1095] scripts/faddr2line: Fix vmlinux detection on arm64 Date: Mon, 15 Aug 2022 20:05:43 +0200 Message-Id: <20220815180508.218799444@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, the 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.1658426357.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=$(${READELF} --file-header $objfile | ${AWK} '$1 == "Type:" { print $2; exit }') - [[ $file_type = "EXEC" ]] && is_vmlinux=1 + if [[ $file_type = "EXEC" ]] || [[ $file_type == "DYN" ]]; then + is_vmlinux=1 + fi # 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 -- 2.35.1