From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YGfjBPkP1l9KFAAA0tVLHw (envelope-from ) for ; Sun, 13 Dec 2020 12:58:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mESlAPkP1l9UAgAAB5/wlQ (envelope-from ) for ; Sun, 13 Dec 2020 12:58:33 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BFD53940148 for ; Sun, 13 Dec 2020 12:58:32 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 161EB28C2E; Sun, 13 Dec 2020 07:58:27 -0500 (EST) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 1CAF628539 for ; Sun, 13 Dec 2020 07:58:24 -0500 (EST) Received: by fethera.tethera.net (Postfix, from userid 1001) id DC1155FC36; Sun, 13 Dec 2020 07:58:23 -0500 (EST) Received: (nullmailer pid 3234384 invoked by uid 1000); Sun, 13 Dec 2020 12:58:22 -0000 From: David Bremner To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH] test/T360-symbol-hiding: use readelf in place of nm In-Reply-To: References: <20201211171706.2780993-1-david@tethera.net> Date: Sun, 13 Dec 2020 08:58:22 -0400 Message-ID: <873609j21d.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: WQ7B5G7MN7EEEDRUCR2GQNFV6JRK2YW3 X-Message-ID-Hash: WQ7B5G7MN7EEEDRUCR2GQNFV6JRK2YW3 X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.27 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: BFD53940148 X-Spam-Score: -0.27 X-Migadu-Scanner: scn1.migadu.com X-TUID: wafT2oR1AxTw Tomi Ollila writes: > On Fri, Dec 11 2020, David Bremner wrote: > >> It turns out that using nm -P isn't as portable as hoped. In particular on >> architectures using ELF v1 (e.g. ppc64), the desired symbols end up in >> the data section instead of text. >> >> The test is currently only functional on ELF based architectures, so I >> think it's legit to depend on readelf instead of nm. >> >> The switch to readelf has the advantage that we can explicitely ask >> for all of the symbols with global visibility, rather than grepping >> for notmuch. That seems a more robust approach since it will catch any >> strangely named global symbols. > > Looks good. I use this opportunity to mention that `sort | uniq` can be > replaced with `sort -u` :D I actually did that, but then thought, there must be some reason we do it this way, maybe portability? Having just checked, I see it's in POSIX 1003.1-2017 (and apparently earlier versions). So I guess it's most likely safe. Applied with s/sort|uniq/sort -u/ and one space deleted.