From patchwork Thu Aug 29 16:09:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 96727 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5F7BA385B50D for ; Thu, 29 Aug 2024 16:09:49 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 83511385DDE6 for ; Thu, 29 Aug 2024 16:09:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 83511385DDE6 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 83511385DDE6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724947784; cv=none; b=DztWx4r5TGnD5w7VUMptGIttQsTFfCQkxlnFLP/nAAwxo3KkQYDExy/NmCI9cXk2C3Pm3lYbkUkahxSf9bSNeKuyJWHKG4ETaEcH2T0YkAxSDT7omh4Gs2+26eu1NoLpect9SkhMA/czmX5no+V2na69Yh0YxnsB9MuT6GNZ//I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724947784; c=relaxed/simple; bh=ZpVTXtFw4MLh+JxUID+gP6jgvi3jAw7OrQtaA3nQhHU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=M49afdTa9o/wnybuw2YRjHjQw8oRHK7T3uOums5fd4DDalSrL/QTt+TzdaJM+VRMZ75XwA6o7IU7u0Bo6jy7JScD4PGGTQEcwbVv1JFsWFvZ4jCC4AFXga3ytW6nSKBaGZNMy3DKGXc18XkPwUI916feJQidJJSk/0BY9DUv0P8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724947781; 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: in-reply-to:in-reply-to:references:references; bh=K4ibaFOTcXlSC7zy4kupFbdXUnVbutAETtR3M8TVljM=; b=Lr3+o22+UkSEWjIiJ3gkoel8PC543r8yl568PMWMQuP7JROeZJwF9u/w+ZAbOziCUoHAE7 Q+Jj/ZLIq9IECzBHnFpipo8q60t6A4YuigTVC6ZcVemfK7DwYfY2w1+P2rKoBemHZ6TIrF h0N1N7roqLwbhTfR4MZsslLCvjUJOUw= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-310-ro96EmaHOvGmIvRkOvvniA-1; Thu, 29 Aug 2024 12:09:39 -0400 X-MC-Unique: ro96EmaHOvGmIvRkOvvniA-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-45680f90e56so14251681cf.3 for ; Thu, 29 Aug 2024 09:09:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724947779; x=1725552579; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K4ibaFOTcXlSC7zy4kupFbdXUnVbutAETtR3M8TVljM=; b=qj0LnFEYwiJlYVh4gZbZ0auUWzNvNUTNU1mIXpkC394FUi9lly+1H6+eV9UV4KGFH7 IzLT8XfUvIKiAJ5/MHF2cXUB19bDuU2FPKcWAZvikTihFORAvP7CFTD4EogrOq988pei s6AbY6DuU1PXXJHO1bY6aeLXteO5ILPKv9eBagKzkaWuSdTBxX6CvS52XjeO36ZUoAyd F0IKV3PygnqCRdEoKUxsMVteIMFPl/Nof1sRHcuy4w5jsIbhCJ0MY9G+GVhqovHHYgji Iu3ebUTLJwKOORLRtiAoZjr0afjgTtVDlxF4WXXW/Je6GpHYEgVL86C4QJVpOx2yZGpY nE5A== X-Gm-Message-State: AOJu0YxY7JV4vMRsfSbFhmmZGE/b4bIcynPGzxqgP1FHyfm02KdyjBlD zzsFrBA3zB1/TLdvaQcBa0wfRbVl/T+o58k0V92YZe/X2hCFRBqr+zkNH2CrfOSgvVyJ9sx28hW e/WGSnUXs6ivSFX7CWGKU6KMaqKAtGGDJXjc/A1nCHiT27dYVYDvdpUZEsA== X-Received: by 2002:a05:622a:610e:b0:450:180:11f0 with SMTP id d75a77b69052e-4567f6c4459mr35780791cf.50.1724947779121; Thu, 29 Aug 2024 09:09:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvNeQf5dzvMCFKQ8Q1/v7h4NURbrjP73FWMC0cbAcxPi9L19SAZ+oNgN1lBw7Wox9XH0nXrw== X-Received: by 2002:a05:622a:610e:b0:450:180:11f0 with SMTP id d75a77b69052e-4567f6c4459mr35780501cf.50.1724947778490; Thu, 29 Aug 2024 09:09:38 -0700 (PDT) Received: from localhost (88-120-130-27.subs.proxad.net. [88.120.130.27]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45682d66e0bsm6007051cf.75.2024.08.29.09.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 09:09:37 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id DD456503C602; Thu, 29 Aug 2024 18:09:35 +0200 (CEST) From: Dodji Seketeli To: dodji@redhat.com Cc: libabigail@sourceware.org Subject: [PATCH 23/27] abidw: Add a --kmi-stablelist option alongside existing --kmi-whitelist Organization: Me, myself and I References: <20240829154711.1883174-1-dodji@redhat.com> X-Operating-System: AlmaLinux 9.4 X-URL: http://www.seketeli.net/~dodji Date: Thu, 29 Aug 2024 18:09:35 +0200 In-Reply-To: <20240829154711.1883174-1-dodji@redhat.com> (dodji@redhat.com's message of "Thu, 29 Aug 2024 17:46:29 +0200") Message-ID: <87ikvjjoow.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, 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 server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces~patchwork=sourceware.org@sourceware.org Hello, * doc/manuals/abidw.rst: Update the documentation. * tools/abidw.cc (display_usage): Add a help string for the new --kmi-stablelist. (parse_command): Parse it. Signed-off-by: Dodji Seketeli --- doc/manuals/abidw.rst | 16 +++++++++------- tools/abidw.cc | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/doc/manuals/abidw.rst b/doc/manuals/abidw.rst index e84047c5..cd3e6253 100644 --- a/doc/manuals/abidw.rst +++ b/doc/manuals/abidw.rst @@ -134,20 +134,22 @@ Options specifications are suppressed from the output of this tool. - * ``--kmi-whitelist | -kaw`` <*path-to-whitelist*> + * ``--kmi-whitelist | --kmi-stablelist |-w`` <*path-to-stablelist*> When analyzing a `Linux Kernel`_ binary, this option points to the - white list of names of ELF symbols of functions and variables - which ABI must be written out. That white list is called a " - Kernel Module Interface white list". This is because for the + list of names of ELF symbols of functions and variables which ABI + must be written out. Any function or variable with a name that is + not included in that list will not ignored. That list is called a + " Kernel Module Interface stable list". This is because for the Kernel, we don't talk about the ABI; we rather talk about the interface between the Kernel and its module. Hence the term - ``KMI`` rather than ``ABI`` + ``KMI`` rather than ``KABI``. Any other function or variable which ELF symbol are not present in - that white list will not be considered by the KMI writing process. + that stable list will not be considered by the KMI writing + process. - If this option is not provided -- thus if no white list is + If this option is not provided -- thus if no stable list is provided -- then the entire KMI, that is, all publicly defined and exported functions and global variables by the `Linux Kernel`_ binaries is emitted. diff --git a/tools/abidw.cc b/tools/abidw.cc index b7642747..87328075 100644 --- a/tools/abidw.cc +++ b/tools/abidw.cc @@ -239,7 +239,7 @@ display_usage(const string& prog_name, ostream& out) "interfaces from the binary" << " --no-linux-kernel-mode don't consider the input binary as " "a Linux Kernel binary\n" - << " --kmi-whitelist|-w path to a linux kernel " + << " --kmi-whitelist|--kmi-stablelist|-w path to a linux kernel " "abi whitelist\n" << " --linux-tree|--lt emit the ABI for the union of a " "vmlinux and its modules\n" @@ -356,6 +356,7 @@ parse_command_line(int argc, char* argv[], options& opts) ++i; } else if (!strcmp(argv[i], "--kmi-whitelist") + || !strcmp(argv[i], "--kmi-stablelist") || !strcmp(argv[i], "-w")) { int j = i + 1;