Re: [PATCH v3 46/64] x86/extable: Define ELF section entry size for exception table

From: Peter Zijlstra
Date: Fri Jun 27 2025 - 06:52:24 EST


On Thu, Jun 26, 2025 at 04:55:33PM -0700, Josh Poimboeuf wrote:

> @@ -193,7 +193,8 @@ static __always_inline __pure void *rip_rel_ptr(void *p)
> ".purgem extable_type_reg\n"
>
> # define _ASM_EXTABLE_TYPE(from, to, type) \
> - " .pushsection \"__ex_table\",\"a\"\n" \
> + " .pushsection __ex_table, \"aM\", @progbits, " \
> + __stringify(EXTABLE_SIZE) "\n" \
> " .balign 4\n" \
> " .long (" #from ") - .\n" \
> " .long (" #to ") - .\n" \
> @@ -201,7 +202,8 @@ static __always_inline __pure void *rip_rel_ptr(void *p)
> " .popsection\n"
>
> # define _ASM_EXTABLE_TYPE_REG(from, to, type, reg) \
> - " .pushsection \"__ex_table\",\"a\"\n" \
> + " .pushsection __ex_table, \"aM\", @progbits, " \
> + __stringify(EXTABLE_SIZE) "\n" \
> " .balign 4\n" \
> " .long (" #from ") - .\n" \
> " .long (" #to ") - .\n" \

This style is much better.