From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E2221AD3F0 for ; Wed, 28 Aug 2024 23:09:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724886566; cv=none; b=d99lVDyqXfRY7JeyMn37PwLd24CARFdOqJqCGLuGSifpEinYF9jsnIdoYhXCm5vNI8agGijXeKtMgr6Tada/b9uDygELD9ZGt/Ptr1AqcMk0soAFvRpqmdD6o7XaKzyIgJu4eqg2NtkTiA/qm0E1v38CiNx8k6gmtTEP5yVT5mE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724886566; c=relaxed/simple; bh=RZmcXzwnrRhYwDoAQj1Jxhe7OhhEeGVabMOYn+OKJEI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WNruQ1fm/2BmbqiLSK6RfjT1NRXeukfNtnlPLeYu38AuzR1xpzn9CHvVQo3bElUcwmCpZnAQiTuoPHirGLplmi5k+d4JOo2ElPYGtSNZm9QR/u97u3V8Rh4d6HCP4DH/v9rH2YcXZe3yf6Ngy5uVdv2ffMFdNLbDDMkXtJD61go= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=H4Mzj55Y; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="H4Mzj55Y" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-20353e5de9cso72075ad.0 for ; Wed, 28 Aug 2024 16:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724886565; x=1725491365; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=bF9tb8hwDYR6xa7gB1x7sZNbhUYJUgSYOVOAb5zjrCw=; b=H4Mzj55Y4gMWJjD1yLPZX94RAzWQmOtv7QN7sKScGjy84ZXuLZl7MRRSW+5n14ADLp 1mv1DSXKXTcK9T4lsvGpZsPosjeUN3M+jNiiBszsGLZTfRzDKl/VC8U0hvjOuRLwfQBP Hm1h5BOIZfPcb7Mrk0/8ENbwdZEijPzrw/qWtU9d8Q8P8np7DcjyDIzVMn+eCsVS9rqY XgrsEuQX3KS7KTat6SaZ1TNqgHSjKoMKtpXROs9+3lDy47NoTCfcQzh7c6oUYckFX8Ah l5fYnYM+0oqAS41V5b59z6BSEwP7RvB186VBIGi5eNx23qGQO5LcFTdj4w+3vvCA4Vih kNGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724886565; x=1725491365; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bF9tb8hwDYR6xa7gB1x7sZNbhUYJUgSYOVOAb5zjrCw=; b=G5FCuM0zC/7MvhrCnvltV8AI1EeVAGsQxyDfH2VIoeF/LNRAa6l6ai3V3/FEs2ei96 PZzRzH0UpAkO/e4Xd8ybCBOFBdoHk+arLjYdyRKXMy6Jz4iKk5jd0nJxLdcsrewk6PJW 3WQUOmlWuqExTqxqnhQXUiyT6PdYMn7krXrEJ8qAMybHeA3JgmkpdbR4ta+d1OuNNRYN vNEzI2hbCAVAg4alUA+EzU/a/+vBGyVeOMLPcaleccmEzoFq9VQ/pUxMsj3QBh11XG3w hcIvDtUwtBodfVJr0kTtoJpkdtevub/H95VTC5AwhaTuTvBOMSoaQT/EDe00rAImCLFZ w3sA== X-Forwarded-Encrypted: i=1; AJvYcCVupg3W36uFga3a0GcrKEBCN1giiKx6WySN8GY00yauSImO9z0pazLJUX/ozIPWeo5tV9U4yFJTcaGXZwisow==@vger.kernel.org X-Gm-Message-State: AOJu0Yzxmsyy/OEymz6CVgdJm2q/A1jjFlPcLhkoLkz3J1bNSuR8fL/c 4d8A/KjA+qXueNp1VKSddUAtgfLNaXxmTn/Vi6AiYB8Jkq690/ARANFr18/6lw== X-Google-Smtp-Source: AGHT+IGefsWlldxzVDyfJdh6ODHqSR4DIkOY4bryKmhorJbglzA63HVpwHsAO+Qawqv6PlgLxud4xg== X-Received: by 2002:a17:902:ce8a:b0:200:7d11:e8e3 with SMTP id d9443c01a7336-2050d1f0c57mr1140385ad.14.1724886564314; Wed, 28 Aug 2024 16:09:24 -0700 (PDT) Received: from google.com (226.75.127.34.bc.googleusercontent.com. [34.127.75.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-715e55a5b56sm5350b3a.57.2024.08.28.16.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 16:09:23 -0700 (PDT) Date: Wed, 28 Aug 2024 23:09:19 +0000 From: Sami Tolvanen To: Petr Pavlu Cc: Masahiro Yamada , Luis Chamberlain , Miguel Ojeda , Greg Kroah-Hartman , Matthew Maurer , Alex Gaynor , Wedson Almeida Filho , Gary Guo , Neal Gompa , Hector Martin , Janne Grunau , Asahi Linux , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH v2 02/19] gendwarfksyms: Add symbol list handling Message-ID: <20240828230919.GI2130480@google.com> References: <20240815173903.4172139-21-samitolvanen@google.com> <20240815173903.4172139-23-samitolvanen@google.com> <95db3178-a2ce-421e-8024-afd7fa3359a3@suse.com> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95db3178-a2ce-421e-8024-afd7fa3359a3@suse.com> On Wed, Aug 28, 2024 at 02:35:29PM +0200, Petr Pavlu wrote: > On 8/15/24 19:39, Sami Tolvanen wrote: > > diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c > > index 65a29d0bd8f4..71cfab0553da 100644 > > --- a/scripts/gendwarfksyms/dwarf.c > > +++ b/scripts/gendwarfksyms/dwarf.c > > @@ -5,6 +5,48 @@ > > [...] > > + > > +static bool is_export_symbol(struct state *state, Dwarf_Die *die) > > +{ > > + Dwarf_Die *source = die; > > + Dwarf_Die origin; > > + > > + state->sym = NULL; > > + > > + /* If the DIE has an abstract origin, use it for type information. */ > > + if (get_ref_die_attr(die, DW_AT_abstract_origin, &origin)) > > + source = &origin; > > + > > + state->sym = symbol_get(get_name(die)); > > + > > + /* Look up using the origin name if there are no matches. */ > > + if (!state->sym && source != die) > > + state->sym = symbol_get(get_name(source)); > > + > > + state->die = *source; > > + return !!state->sym; > > +} > > Sorry, I don't want to comment much on function names.. but I realized > the name of is_export_symbol() isn't really great. The "is_" prefix > strongly indicates that it is only a query function, yet it changes the > state. It makes its caller process_exported_symbols() hard to understand > on the first read. I see your point. How would you make this more obvious? get_ doesn't seem entirely accurate either. match_ perhaps? Sami