lkml.org 
[lkml]   [2021]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 04/12] module: Add printk format to add module build ID to stacktraces
On Thu, Apr 08, 2021 at 03:44:57PM +0200, Jessica Yu wrote:
> +++ Stephen Boyd [30/03/21 20:05 -0700]:

...

> > +static void init_build_id(struct module *mod, const struct load_info *info)
> > +{
> > + const Elf_Shdr *sechdr;
> > + unsigned int i;
> > +
> > + for (i = 0; i < info->hdr->e_shnum; i++) {
> > + sechdr = &info->sechdrs[i];
> > + if (!sect_empty(sechdr) && sechdr->sh_type == SHT_NOTE &&
> > + !build_id_parse_buf((void *)sechdr->sh_addr, mod->build_id,
> > + sechdr->sh_size))
> > + break;
> > + }
> > +}
>
> Why not just look for the .note.gnu.build-id section instead of trying
> to parse each note section? Doesn't it always contain the build id? At
> least the ld man page seems to suggest this section name should be
> consistent.

Interesting idea (in positive way!), I'm wondering what Clang does in such
case.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-04-08 16:06    [W:0.096 / U:1.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site