From nobody Wed Jul 13 16:47:44 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B822017FCAD8; Wed, 13 Jul 2022 16:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ljk7h2jrNz3WX1; Wed, 13 Jul 2022 16:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657730864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2QgKrsj5BjVC2O7FufVrvPmWTFqJQgMax5+W8aZ3a74=; b=dooUwUSRW6X4W2G27PuT9SCbFJE+gSYb45P/CrdkvvQ0gLAahHnRxnANQ3gFOB5B6wRykx TtG7Yz9BJ/h+OhIURDdfuYD5sacqQuYC9fOE0nXOhfdw6UlxjwArORsjT07zQ1VYnk+XLx XmB0lz3WpKc2QmBdTLaiiXib+4s1+CY2x5JzCZ6UnNabdFF4dtAsVWtt62R8Z/soFJLSG8 krFUb8tRSYj7/kwDynkZPADUMAMV5LMkXEtSpBoANG/E1DQlFLkeZnfT8CQ2smdvsaHXs0 Bd7WxhohCttbdrNt7JsEEojgBxiZjCcTCXizsFnWtzRYFhnHVWLQvcOex9lqSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ljk7h1pchzWC1; Wed, 13 Jul 2022 16:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26DGli64052329; Wed, 13 Jul 2022 16:47:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26DGli2T052328; Wed, 13 Jul 2022 16:47:44 GMT (envelope-from git) Date: Wed, 13 Jul 2022 16:47:44 GMT Message-Id: <202207131647.26DGli2T052328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 041857e57b3d - stable/13 - pmcannotate: Don't increment end address passed to objdump -d. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 041857e57b3d0831b5bdf583f684a7ed3816999c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657730864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2QgKrsj5BjVC2O7FufVrvPmWTFqJQgMax5+W8aZ3a74=; b=Aj4O2hFmuxGHVXn0WYBHJ/7C2Uie7vpypNubvzZo9hl9jry0iVxX1FCU8GAFGxdVx1u9iw gWYSJq1H4olKZkDDLKW+rbBCR3cQTxSvLY9OI1r5kZKHYsvR73NFU9wp75f15dB5qn+UAv WaVl5lcp8rX1cd1MMnv50b6IzpMa5FHk279JMdAcwoL4q2AORt8gC2H6XOyZwDA2f9Vnxd ABEwyM1CanlpMXao+pjoUlwCfPiP0KLEmU8KQepDBuWCcdcnLjQ425D0JJNWkRdHb91dCG yOiNWrt/D9vw/ntPvRdlMKF1kF/03NZVGXlkChA3DjTMjijI9yjWB1ZAydGJrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657730864; a=rsa-sha256; cv=none; b=MnP6xAvODmZS7+l85kQ2YX6Sbu64eBh+H2BL+3XmZmKfagLfNkh7LP+vhkqwNJTRTU90VZ rwHyX2WSsSgKsmyYQZ1z888f0uPtAcYlC7qGXdFcbNqFWf/5zaGfuTUCspn7CRz1FrRe4v QJuR8wzA6mmubx/ATXK63QLtXfYw7kaAPpZg7VXlRqzx+kgueAPWEAMESsSv6hJkeUtjph xW2Za23dBqcCe4UksT/39scU0PM6jXhh72eepQCJRHa03C0BH65Gxba3p4rOfgRtpDU+5C 4oqPd2JzFusTryF4v1wScceZqVGAXj73SDtQ1KAZrmZCKNFfEUJ0dBmLNumG+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=041857e57b3d0831b5bdf583f684a7ed3816999c commit 041857e57b3d0831b5bdf583f684a7ed3816999c Author: John Baldwin AuthorDate: 2022-06-14 17:52:54 +0000 Commit: John Baldwin CommitDate: 2022-07-13 16:20:45 +0000 pmcannotate: Don't increment end address passed to objdump -d. libpmc already returns an end address that is after the end of the last instruction of a function (on both amd64 and arm64) as the end address written to the annotate map file is computed as the start address of the symbol plus the size. Adding one could result in a curious failure where an entire function's contents in assembly was reduced instead to only the first instruction. The reason is that when the end instruction is bumped by one, objdump -d can append the first instruction of the next function in its output. However, since pmcannotate concatenates all of the objdump -d output from various functions into a single file which it then searches to find the assembly for a given file, if this additional trailer was earlier in the file than the full function, the trailer was chosen to represent the entire function resulting in the truncated listing of the function. Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D35399 (cherry picked from commit 73702c398046d8e01e6a0f5860b7e75cd37a9518) --- usr.sbin/pmcannotate/pmcannotate.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/usr.sbin/pmcannotate/pmcannotate.c b/usr.sbin/pmcannotate/pmcannotate.c index 03f384d3f531..f3ffeed92738 100644 --- a/usr.sbin/pmcannotate/pmcannotate.c +++ b/usr.sbin/pmcannotate/pmcannotate.c @@ -434,11 +434,6 @@ fqueue_getall(const char *bin, char *temp, int asmf) start = agg->ag_ostart; end = agg->ag_oend; - /* - * Fix-up the end address in order to show it in the objdump's - * trace. - */ - end++; if (asmf) snprintf(tmpf, sizeof(tmpf), "objdump --start-address=%p "