Re: [PATCH v2 20/53] objtool/klp: Don't correlate .rodata.cst* constant pool objects

Josh Poimboeuf <[email protected]>
Newsgroups org.kernel.vger.live-patching,org.kernel.vger.linux-kernel
Message-ID <yd3becobjg77p7yylqqgmrdznkejvwbdzojzxk5lqlsihp4377@d6yfaqstriec>
On Fri, May 01, 2026 at 11:37:49AM +0100, Song Liu wrote:
> > +/*
> > + * Some .rodata is anonymous and can't be correlated due to there being no
> > + * symbol names.
> > + *
> > + * The .rodata.cst* sections aren't technically anonymous, they're SHF_MERGE
> > + * constant pool sections containing small fixed-size data (lookup tables,
> > + * bitmasks) which are only read by value, so pointer equivalence isn't needed.
> > + * They are typically referenced by UBSAN data sections.
> > + */
> > +static bool is_anonymous_rodata(struct symbol *sym)
> > +{
> > +       return is_rodata_sec(sym->sec) &&
> > +              (!is_object_sym(sym) || strstarts(sym->sec->name, ".rodata.cst"));
> > +}
> > +
> >  /*
> >   * These symbols should never be correlated, so their local patched versions
> >   * are used instead of linking to the originals.
> > @@ -386,7 +401,7 @@ static bool dont_correlate(struct symbol *sym)
> >                is_uncorrelated_static_local(sym) ||
> >                is_local_label(sym) ||
> >                is_string_sec(sym->sec) ||
> > -              (is_rodata_sec(sym->sec) && !is_object_sym(sym)) ||
> ^^^^
> This line was added in 19/53. Maybe we can merge 19 and 20?

I think I'd prefer to keep them separate as they are two distinct issues
related to rodata: pointer equivalence (patch 19) and UBSAN mergeable
constants (patch 20).

-- 
Josh
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.