Re: [PATCH 02/17] x86, lto: Mark all top level asm statements as .text
From: Ingo Molnar
Date: Wed Mar 27 2019 - 10:39:52 EST
* Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> Proper fix below.
>
> Thanks,
>
> tglx
>
> 8<-------------------
>
> --- a/arch/x86/include/asm/paravirt_types.h
> +++ b/arch/x86/include/asm/paravirt_types.h
> @@ -367,11 +367,15 @@ extern struct paravirt_patch_template pv
> _paravirt_alt(insn_string, "%c[paravirt_typenum]", "%c[paravirt_clobber]")
>
> /* Simple instruction patching code. */
> -#define NATIVE_LABEL(a,x,b) "\n\t.globl " a #x "_" #b "\n" a #x "_" #b ":\n\t"
> +#define NATIVE_LABEL(a,x,b) "\n" a #x "_" #b ":\n\t"
>
> #define DEF_NATIVE(ops, name, code) \
> - __visible extern const char start_##ops##_##name[], end_##ops##_##name[]; \
> - asm(NATIVE_LABEL("start_", ops, name) code NATIVE_LABEL("end_", ops, name))
> + static const char start_##ops##_##name[], end_##ops##_##name[]; \
> + asm(".pushsection .rodata, \"a\"\n" \
> + NATIVE_LABEL("start_", ops, name) \
> + code \
> + NATIVE_LABEL("end_", ops, name) \
> + ".popsection\n")
Acked-by: Ingo Molnar <mingo@xxxxxxxxxx>
Thanks,
Ingo