Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp191902iob; Mon, 2 May 2022 16:47:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys59TaZXXbLQmrTonrNTuBKNI6A2Rm2nQ28BsANDfvWsOWUEonig+mbPxe+Dxbgwjnn5hY X-Received: by 2002:a17:902:ea57:b0:15a:6173:87dd with SMTP id r23-20020a170902ea5700b0015a617387ddmr14233998plg.147.1651535248527; Mon, 02 May 2022 16:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651535248; cv=none; d=google.com; s=arc-20160816; b=VOtDxcLE9rBBaushkDNodI+O5Gh8MLmOpdyBvQjWTurYQkFHdjmSlwC5Qyu1CjXNuH TInwaQZ0oTEC1Alt3qYu4vAMLTdp1RMVorK21o5bTXL5dqplm6CJsiJrRZdW96c2OvRc VsLeXOCo8cBhVolf6YhnDHDotsfyOHwcEk5p/oGWsjgzYNCQ+p02RpuFjle5vNzR/j7i /dBomHuqdwRk8bzDVT7m3DaKuTzgRA6bU1IIB5uA4qKOMl5AwDKOhcvGGrrgGcyrpxRB EdfWknpHPJ8rdMPFcFZs75EjOHBGJ87NKTCXhOHwz/yZKwm9MMUrZuVZQruyyrPzEOtn A2wg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=dyNqZVYhXKJlbY+/8+YtCApI8QKTUCGVr4RjpVxY1Yo=; b=lgMT8KSb25cE3deHp6a6Et2zO1mT9soa7MR8EMLxLGlbxB80dq8Q503t20B9A+gNMs Q6ASjbQgr2nWcJF2TtKD7ip8rtYnpU/mKo/yOQrQhOVYxu9zvEy3zHZ1TTy26VE1A0pa x6dz3wbS+0HuNE5b/y4nRbUT0ixKcPsYNLhevYjDJRlqWvuKbcRzhnOYslk/pofTAnb5 yDKYhFZDRj8ngOv5YcLcqHjH2vvsiX1IPF2V1pH4Os4MMXCqx9VCyZxB043GjK8NiV8w BE7mLKf27czioN1aN05qoxALr4jjkhK2XtnfjvgHiBTIhLsRoNbbH4OewTkF4Q72dnsb 2nuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Kbowrsaq; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id mu4-20020a17090b388400b001d22ac4fe6csi781277pjb.92.2022.05.02.16.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:47:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Kbowrsaq; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 067C2338B3; Mon, 2 May 2022 16:47:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387206AbiEBUMA (ORCPT + 99 others); Mon, 2 May 2022 16:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387324AbiEBULw (ORCPT ); Mon, 2 May 2022 16:11:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8C256DFC0 for ; Mon, 2 May 2022 13:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651522086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dyNqZVYhXKJlbY+/8+YtCApI8QKTUCGVr4RjpVxY1Yo=; b=KbowrsaqnT2TVaT0F7uCIZN1SGqyHbO4nyS+tdonlpRSo1etP7nI3troBxWFKvW6N4K7Ra mlgS2qsqEXjTnyykSh+mMLJ3gB7JZ86agJMQXmHljAukO5lstGMMFoNGi445bb6DpUDUvK 9DbcHbtkcsNi4hRuNazQCuSQYIF4GHs= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-443-n_ntuXgFNcCAv84Yw-4xng-1; Mon, 02 May 2022 16:08:05 -0400 X-MC-Unique: n_ntuXgFNcCAv84Yw-4xng-1 Received: by mail-qt1-f199.google.com with SMTP id x5-20020a05622a000500b002f37cb8b803so11794706qtw.9 for ; Mon, 02 May 2022 13:08:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dyNqZVYhXKJlbY+/8+YtCApI8QKTUCGVr4RjpVxY1Yo=; b=DmazpjMNIKInAL+/R1egzmVeGWwlcoI2LyUWNf02Xo0hfH1o1rMvhSvBJu5GtALDNT cdakoNnvkMhQoXSalw9ELSMdeN2kn37//D2zKPxPLWPeblbjqr6Pmq3aQA+2jL9eF/2e IHK/hGNmoMIMokRegQUfQlh04g05vK+/c3RyquNZB2GeONULnKWImoGko62rRG+pCe1s DfbAgmQLWab7IKi4a3RQXqO7dxpK5r9I9aVffbQuTKG2uzTHBl9hMrKp9XFdv9MWUVou hNQusRJelglMSIURQx8zfi4ZMnPO7OtMkH3xsoeVV4j7n3OVWvtGPLusnm7/tPq1L0LT P4zQ== X-Gm-Message-State: AOAM532N9mzRdbOxLCZsYpQpfxj+R6d7VtPQf1cQej/65Yak4TbX66SA 16PtInK3GXJr6sIbG0JMtoBvFCvWq6fdI5tHEhd3iJ3KlFa787VrjQ3E4xAdLJEyQeqAOgkFzDm Bfufwf1K9F7BuVLFge0RB5oYc X-Received: by 2002:a05:620a:269a:b0:680:a5c5:954e with SMTP id c26-20020a05620a269a00b00680a5c5954emr9796525qkp.468.1651522084253; Mon, 02 May 2022 13:08:04 -0700 (PDT) X-Received: by 2002:a05:620a:269a:b0:680:a5c5:954e with SMTP id c26-20020a05620a269a00b00680a5c5954emr9796509qkp.468.1651522083972; Mon, 02 May 2022 13:08:03 -0700 (PDT) Received: from treble.attlocal.net ([2600:1700:6e32:6c00::a]) by smtp.gmail.com with ESMTPSA id b23-20020ac87557000000b002f39b99f6basm4571050qtr.84.2022.05.02.13.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 13:08:03 -0700 (PDT) From: Josh Poimboeuf To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org Subject: [PATCH] scripts/faddr2line: s/vmlinux.o/vmlinux Date: Mon, 2 May 2022 13:07:55 -0700 Message-Id: <8740f545113b132a412ad2a46f382c69e930dda1.1651522024.git.jpoimboe@redhat.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Fix Peter Zijlstra's use case of running faddr2line on vmlinux.o. This avoids (for now) the task of having to make this script a lot smarter. Fixes the following issue: $ ./scripts/faddr2line vmlinux.o enter_from_user_mode+0x24 bad symbol size: base: 0x0000000000005fe0 end: 0x0000000000005fe0 Reported-by: Peter Zijlstra Signed-off-by: Josh Poimboeuf --- scripts/faddr2line | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/faddr2line b/scripts/faddr2line index 2a130134f1e6..564774803b9f 100755 --- a/scripts/faddr2line +++ b/scripts/faddr2line @@ -202,6 +202,19 @@ LIST=0 [[ ! -f $objfile ]] && die "can't find objfile $objfile" shift +# HACK: s/vmlinux.o/vmlinux +# +# peterz likes to run this script on vmlinux.o, which is more likely to run up +# against the inherent limitations of this script being based on 'nm', which +# lumps the symbol offsets of all text sections together. If the offset is +# valid for multiple text sections, faddr2line will get confused. +# +# This issue doesn't *only* affect vmlinux.o, but vmlinux.o is most likely to +# see it compared to other .o files. Someday, if necessary, we may need to +# instead turn this script into a much smarter one which relies on a real tool +# like readelf which can differentiate between text sections. +objfile=${objfile/vmlinux.o/vmlinux} + DIR_PREFIX=supercalifragilisticexpialidocious find_dir_prefix $objfile -- 2.34.1