From: David Daney Date: Wed, 8 Mar 2017 01:31:08 +0000 (-0800) Subject: module: set .init_array alignment to 8 X-Git-Tag: v4.12-rc1~104^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5bd933fe4481688d595ae1dd0440006c8675a1a8;p=thirdparty%2Fkernel%2Flinux.git module: set .init_array alignment to 8 The proper idiom for aligning linker sections in modules is different than for built-in sections. ". = ALIGN();" followed by a forced output address of 0 does nothing, as forcing the address changes the value of ".". Use output section alignment specifier instead. Fixes: 9ddf82521c86 ("kernel: add support for .init_array.* constructors") Reviewed-by: Andrey Ryabinin Signed-off-by: David Daney Signed-off-by: Jessica Yu --- diff --git a/scripts/module-common.lds b/scripts/module-common.lds index 9b6e246a45d09..d61b9e8678e8c 100644 --- a/scripts/module-common.lds +++ b/scripts/module-common.lds @@ -20,8 +20,7 @@ SECTIONS { __kcrctab_unused_gpl 0 : { *(SORT(___kcrctab_unused_gpl+*)) } __kcrctab_gpl_future 0 : { *(SORT(___kcrctab_gpl_future+*)) } - . = ALIGN(8); - .init_array 0 : { *(SORT(.init_array.*)) *(.init_array) } + .init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) } __jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) } }