From owner-dev-commits-src-main@freebsd.org Thu Jan 14 20:11:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E643A4EC3FD; Thu, 14 Jan 2021 20:11:12 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DGwS06C22z4sXp; Thu, 14 Jan 2021 20:11:12 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C79A47E48; Thu, 14 Jan 2021 20:11:12 +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 10EKBCFh091336; Thu, 14 Jan 2021 20:11:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10EKBCWs091335; Thu, 14 Jan 2021 20:11:12 GMT (envelope-from git) Date: Thu, 14 Jan 2021 20:11:12 GMT Message-Id: <202101142011.10EKBCWs091335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 3dfcb70b6ae9 - main - elfctl: add backwards compatibility for "no" prefixes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3dfcb70b6ae9bcb9fd6a66721bebdb8c6a53c329 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2021 20:11:13 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3dfcb70b6ae9bcb9fd6a66721bebdb8c6a53c329 commit 3dfcb70b6ae9bcb9fd6a66721bebdb8c6a53c329 Author: Ed Maste AuthorDate: 2021-01-13 19:21:38 +0000 Commit: Ed Maste CommitDate: 2021-01-14 20:09:08 +0000 elfctl: add backwards compatibility for "no" prefixes I am going to prefix opt-out ELF feature flag names with "no" to make their meaning more clear (review D28139), but there are some uses of the existing names already (e.g., the PR referenced below). For now accept the older, unprefixed name as well, and emit a warning. We can revert this after FreeBSD 13 branches. % elfctl -e +aslr foo elfctl: interpreting aslr as noaslr; please specify noaslr PR: 239873 (related) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28140 --- usr.bin/elfctl/elfctl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c index 9d75c002d82c..570bdba2e2be 100644 --- a/usr.bin/elfctl/elfctl.c +++ b/usr.bin/elfctl/elfctl.c @@ -232,6 +232,16 @@ convert_to_feature_val(char *feature_str, uint32_t *feature_val) input |= featurelist[i].value; break; } + /* XXX Backwards compatibility for "no"-prefix flags. */ + if (strncmp(featurelist[i].alias, "no", 2) == 0 && + strcmp(featurelist[i].alias + 2, feature) == 0) { + input |= featurelist[i].value; + warnx( + "interpreting %s as %s; please specify %s", + feature, featurelist[i].alias, + featurelist[i].alias); + break; + } } if (i == len) { warnx("%s is not a valid feature", feature);