Re: [PATCH v2 45/62] x86/extable: Define ELF section entry size for exception tables

From: Brian Gerst
Date: Fri Jun 06 2025 - 21:26:54 EST


On Fri, Jun 6, 2025 at 3:48 AM Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> On Thu, Jun 05, 2025 at 11:58:23PM -0400, Brian Gerst wrote:
> > On Fri, May 9, 2025 at 4:51 PM Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
> > >
> > > In preparation for the objtool klp diff subcommand, define the entry
> > > size for the __ex_table section in its ELF header. This will allow
> > > tooling to extract individual entries.
> > >
> > > Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> > > ---
> > > arch/x86/include/asm/asm.h | 20 ++++++++++++--------
> > > kernel/extable.c | 2 ++
> > > 2 files changed, 14 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
> > > index f963848024a5..62dff336f206 100644
> > > --- a/arch/x86/include/asm/asm.h
> > > +++ b/arch/x86/include/asm/asm.h
> > > @@ -138,15 +138,17 @@ static __always_inline __pure void *rip_rel_ptr(void *p)
> > >
> > > # include <asm/extable_fixup_types.h>
> > >
> > > +#define EXTABLE_SIZE 12
> >
> > Put this in asm-offsets.c instead.
>
> But that's only for .S code right? This is also needed for inline asm.

<asm/asm-offsets.h> can be used in C code too. Normally it wouldn't
be needed but the inline asm case is a valid use.


Brian Gerst