lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250630072938.GD1613200@noisy.programming.kicks-ass.net>
Date: Mon, 30 Jun 2025 09:29:38 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
	Petr Mladek <pmladek@...e.com>, Miroslav Benes <mbenes@...e.cz>,
	Joe Lawrence <joe.lawrence@...hat.com>,
	live-patching@...r.kernel.org, Song Liu <song@...nel.org>,
	laokz <laokz@...mail.com>, Jiri Kosina <jikos@...nel.org>,
	Marcos Paulo de Souza <mpdesouza@...e.com>,
	Weinan Liu <wnliu@...gle.com>,
	Fazla Mehrab <a.mehrab@...edance.com>,
	Chen Zhongjin <chenzhongjin@...wei.com>,
	Puranjay Mohan <puranjay@...nel.org>,
	Dylan Hatch <dylanbhatch@...gle.com>
Subject: Re: [PATCH v3 26/64] objtool: Add section/symbol type helpers

On Fri, Jun 27, 2025 at 09:36:08AM -0700, Josh Poimboeuf wrote:
> On Fri, Jun 27, 2025 at 12:29:30PM +0200, Peter Zijlstra wrote:
> > Naming seems inconsistent, there are:
> >
> >   sym_has_sec(), sec_changed() and sec_size()
> >
> > which have the object first, but then most new ones are:
> > 
> >   is_foo_sym() and is_foo_sec()
> > 
> > which have the object last.
> 
> For the "is_()" variants, I read them as:
> 
>   "is a(n) <adjective> <noun>"
> 
> e.g.:
> 
>   is_undef_sym(): "is an UNDEF symbol"
>   is_file_sym():  "is a FILE symbol"
>   is_string_sec() "is a STRING section"
> 
> Nerding out on English for a second, many of those adjectives can be
> read as noun adjuncts, e.g. "chicken soup", where a noun functions as an
> adjective.
> 
> If we changed those to:
> 
>   "is <noun> <adjective>?"
> 
> or
> 
>   "is <noun> a <noun>?"
> 
> then it doesn't always read correctly:
> 
>   is_sym_file():   "is symbol a file?"
>   is_sec_string(): "is section a string?"

English aside; things like sym_*() create a clear namespace, and
sym_is_file() can be easily read as sym::is_file().



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ