From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by sourceware.org (Postfix) with ESMTPS id 6C50D385B834 for ; Mon, 22 Jun 2020 09:46:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6C50D385B834 Received: by mail-io1-xd44.google.com with SMTP id u13so18704746iol.10 for ; Mon, 22 Jun 2020 02:46:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EZR9EzQ57qszgSmuV1OBHCnv+qF4JF8MEH1MmtCXkAM=; b=JR953O4OZ+IuWZnTDAkjWPyIn+C6I/+HUWU0q+w46kovRXbj/22IAB7Xi8hKMtfFLu xJ7J5VOefH83GwCy1QABXOd1CUhbCv5Lgzoesxn0QkK/M07v+RyrVU3azk/Jd4auEHQa NMyNwG8ptIGrho7xhyNAeex/yhPQ32Q+uwqtvcOr+HIhaOs2w9ngfuR1+6aV/nhF4G2l JiHO0qhV2KQtUds9oYcFBeTuohpkk3Psy+qOtG2GYXQqlGYpTkz5hTwAXvj9esJ5+bbd SY92jbQh/q0V9HmXPi84LoIUfVKvnmKd3gKDj142ldhBURnbZgcK9nsrVGQAcGz6w6Q5 c/hw== X-Gm-Message-State: AOAM5310XAGyzqHr6AkE0RNEz47XOgRD6lIcBM+9t3QMYr/nty2TCUGo MKrSL5EEElZtApw7CVcV2zHeoAtLe9nqWdEp1/4NmQ== X-Google-Smtp-Source: ABdhPJzSUbg+Uol5mysTG+f/QWzc/IDM6xjHHts4u233XoIZ06N3oDvsXZ6GeT6EaOYrZBQ8ma/E7K/1b8okjxmvgsQ= X-Received: by 2002:a6b:7d02:: with SMTP id c2mr16817786ioq.146.1592819208702; Mon, 22 Jun 2020 02:46:48 -0700 (PDT) MIME-Version: 1.0 References: <20200619214305.562-1-maennich@google.com> <20200619214305.562-5-maennich@google.com> In-Reply-To: <20200619214305.562-5-maennich@google.com> From: Giuliano Procida Date: Mon, 22 Jun 2020 10:46:31 +0100 Message-ID: Subject: Re: [PATCH v1 04/16] abg-ir: elf_symbol: add is_suppressed field To: Matthias Maennich Cc: libabigail@sourceware.org, Dodji Seketeli , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-29.6 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2020 09:46:50 -0000 Hi. On Fri, 19 Jun 2020 at 22:43, Matthias Maennich wrote: > > In the context of libabigail and a single library run (when reading from > dwarf or from xml), a symbol is either suppressed or it is not. While > one could argue that this is a property of the read_context, the > read_context might not be around anymore when the symbol still is. > Hence, persist the 'is_suppressed' state along with the symbol itself. > > * include/abg-ir.h (elf_symbol::elf_symbol): Add is_suppressed > parameter. > (elf_symbol::create): Likewise. > (elf_symbol::is_suppressed): New getter declaration. > (elf_symbol::set_is_suppressed): New setter declaration. > * src/abg-ir.cc (elf_symbol::priv::priv): Add is_suppressed > parameter. > (elf_symbol::priv::is_suppressed_): New field. > (elf_symbol::elf_symbol): Add is_suppressed parameter. > (elf_symbol::create): Likewise. > (elf_symbol::is_suppressed): New getter implementation. > (elf_symbol::set_is_suppressed): New setter implementation. > Reviewed-by: Giuliano Procida > Signed-off-by: Matthias Maennich > --- > include/abg-ir.h | 12 ++++++++++-- > src/abg-ir.cc | 29 ++++++++++++++++++++++------- > 2 files changed, 32 insertions(+), 9 deletions(-) > > diff --git a/include/abg-ir.h b/include/abg-ir.h > index 5766385c8b73..838d3f80695a 100644 > --- a/include/abg-ir.h > +++ b/include/abg-ir.h > @@ -853,7 +853,8 @@ private: > const version& ve, > visibility vi, > bool is_linux_string_cst = false, > - bool is_in_ksymtab = false); > + bool is_in_ksymtab = false, > + bool is_suppressed = false); > > elf_symbol(const elf_symbol&); > > @@ -877,7 +878,8 @@ public: > const version& ve, > visibility vi, > bool is_linux_string_cst = false, > - bool is_in_ksymtab = false); > + bool is_in_ksymtab = false, > + bool is_suppressed = false); > > const environment* > get_environment() const; > @@ -951,6 +953,12 @@ public: > void > set_is_in_ksymtab(bool is_in_ksymtab); > > + bool > + is_suppressed() const; > + > + void > + set_is_suppressed(bool is_suppressed); > + > const elf_symbol_sptr > get_main_symbol() const; > > diff --git a/src/abg-ir.cc b/src/abg-ir.cc > index 44021132b04d..44529c6617b0 100644 > --- a/src/abg-ir.cc > +++ b/src/abg-ir.cc > @@ -1301,6 +1301,7 @@ struct elf_symbol::priv > bool is_common_; > bool is_linux_string_cst_; > bool is_in_ksymtab_; > + bool is_suppressed_; > elf_symbol_wptr main_symbol_; > elf_symbol_wptr next_alias_; > elf_symbol_wptr next_common_instance_; > @@ -1316,7 +1317,8 @@ struct elf_symbol::priv > is_defined_(false), > is_common_(false), > is_linux_string_cst_(false), > - is_in_ksymtab_(false) > + is_in_ksymtab_(false), > + is_suppressed_(false) > {} > > priv(const environment* e, > @@ -1330,7 +1332,8 @@ struct elf_symbol::priv > const elf_symbol::version& ve, > elf_symbol::visibility vi, > bool is_linux_string_cst, > - bool is_in_ksymtab) > + bool is_in_ksymtab, > + bool is_suppressed) > : env_(e), > index_(i), > size_(s), > @@ -1342,7 +1345,8 @@ struct elf_symbol::priv > is_defined_(d), > is_common_(c), > is_linux_string_cst_(is_linux_string_cst), > - is_in_ksymtab_(is_in_ksymtab) > + is_in_ksymtab_(is_in_ksymtab), > + is_suppressed_(is_suppressed) > { > if (!is_common_) > is_common_ = type_ == COMMON_TYPE; > @@ -1399,7 +1403,8 @@ elf_symbol::elf_symbol(const environment* e, > const version& ve, > visibility vi, > bool is_linux_string_cst, > - bool is_in_ksymtab) > + bool is_in_ksymtab, > + bool is_suppressed) > : priv_(new priv(e, > i, > s, > @@ -1411,7 +1416,8 @@ elf_symbol::elf_symbol(const environment* e, > ve, > vi, > is_linux_string_cst, > - is_in_ksymtab)) > + is_in_ksymtab, > + is_suppressed)) > {} > > /// Factory of instances of @ref elf_symbol. > @@ -1469,11 +1475,12 @@ elf_symbol::create(const environment* e, > const version& ve, > visibility vi, > bool is_linux_string_cst, > - bool is_in_ksymtab) > + bool is_in_ksymtab, > + bool is_suppressed) > { > elf_symbol_sptr sym(new elf_symbol(e, i, s, n, t, b, d, c, ve, vi, > is_linux_string_cst, > - is_in_ksymtab)); > + is_in_ksymtab, is_suppressed)); > sym->priv_->main_symbol_ = sym; > return sym; > } > @@ -1701,6 +1708,14 @@ void > elf_symbol::set_is_in_ksymtab(bool is_in_ksymtab) > {priv_->is_in_ksymtab_ = is_in_ksymtab;} > > +bool > +elf_symbol::is_suppressed() const > +{return priv_->is_suppressed_;} > + > +void > +elf_symbol::set_is_suppressed(bool is_suppressed) > +{priv_->is_suppressed_ = is_suppressed;} > + > /// @name Elf symbol aliases > /// > /// An alias A for an elf symbol S is a symbol that is defined at the > -- > 2.27.0.111.gc72c7da667-goog >