[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2oublab5wrfzneispi4sqb6feiw2abc3mzxozmx53btuvseljh@3qsmyluomyir>
Date: Mon, 9 Jun 2025 16:21:11 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Joe Lawrence <joe.lawrence@...hat.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Petr Mladek <pmladek@...e.com>, Miroslav Benes <mbenes@...e.cz>, 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>
Subject: Re: [PATCH v2 52/62] objtool/klp: Introduce klp diff subcommand for
diffing object files
On Mon, Jun 09, 2025 at 02:32:19PM -0400, Joe Lawrence wrote:
> On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> > +static int validate_ffunction_fdata_sections(struct elf *elf)
> > +{
> > + struct symbol *sym;
> > + bool found_text = false, found_data = false;
> > +
> > + for_each_sym(elf, sym) {
> > + char sec_name[SEC_NAME_LEN];
> > +
> > + if (!found_text && is_func_sym(sym)) {
> > + snprintf(sec_name, SEC_NAME_LEN, ".text.%s", sym->name);
> > + if (!strcmp(sym->sec->name, sec_name))
> > + found_text = true;
> > + }
> > +
> > + if (!found_data && is_object_sym(sym)) {
> > + snprintf(sec_name, SEC_NAME_LEN, ".data.%s", sym->name);
> > + if (!strcmp(sym->sec->name, sec_name))
> > + found_data = true;
>
> Hi Josh,
>
> Should we check for other data section prefixes here, like:
>
> else {
> snprintf(sec_name, SEC_NAME_LEN, ".rodata.%s", sym->name);
> if (!strcmp(sym->sec->name, sec_name))
> found_data = true;
> }
Indeed. And also .bss.*.
> At the same time, while we're here, what about other .text.* section
> prefixes?
AFAIK, .text.* is the only one.
--
Josh
Powered by blists - more mailing lists