On Mon, Mar 15, 2021 at 12:03:21PM -0500, Josh Poimboeuf wrote:
> On Mon, Mar 15, 2021 at 01:08:27PM +0100, Peter Zijlstra wrote:
> > On Mon, Mar 15, 2021 at 12:26:12PM +0100, Peter Zijlstra wrote:
> > > Ooooh, modules don't have this. They still have regular
> > > .static_call_sites sections, and *those* are unaligned.
> > > 
> > > Section Headers:
> > > [Nr] Name              Type            Address          Off    Size   ES 
> > > Flg Lk Inf Al
> > > 
> > > [16] .static_call_sites PROGBITS        0000000000000000 008aa1 0006f0 00 
> > >  WA  0   0  1
> > > 
> > > And that goes *BOOM*.. Let me ses if I can figure out how to make
> > > objtool align those sections.
> > 
> > The below seems to have cured it:
> > 
> > [16] .static_call_sites PROGBITS        0000000000000000 008aa8 0006f0 00  
> > WA  0   0  8
> > 
> > 
> > So, anybody any opinion on if we ought to do this?
> 
> I'd say yes to alignment, for the sake of consistency with vmlinux.
> 
> Though instead of using objtool, it can be done in the module linker
> script:

Pfff, I should've looked for one.. Yes, that's much nicer.

> diff --git a/scripts/module.lds.S b/scripts/module.lds.S
> index 168cd27e6122..73345cbfe100 100644
> --- a/scripts/module.lds.S
> +++ b/scripts/module.lds.S
> @@ -17,6 +17,7 @@ SECTIONS {
>       .init_array             0 : ALIGN(8) { *(SORT(.init_array.*)) 
> *(.init_array) }
>  
>       __jump_table            0 : ALIGN(8) { KEEP(*(__jump_table)) }
> +     .static_call_sites      0 : ALIGN(8) { KEEP(*(.static_call_sites)) }
>  
>       __patchable_function_entries : { *(__patchable_function_entries) }
>  
> 

Reply via email to