Skip to content

Commit 5bd933f

Browse files
daviddaneyJessica Yu
authored and
Jessica Yu
committed
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: 9ddf825 ("kernel: add support for .init_array.* constructors") Reviewed-by: Andrey Ryabinin <[email protected]> Signed-off-by: David Daney <[email protected]> Signed-off-by: Jessica Yu <[email protected]>
1 parent 4495c08 commit 5bd933f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: scripts/module-common.lds

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ SECTIONS {
2020
__kcrctab_unused_gpl 0 : { *(SORT(___kcrctab_unused_gpl+*)) }
2121
__kcrctab_gpl_future 0 : { *(SORT(___kcrctab_gpl_future+*)) }
2222

23-
. = ALIGN(8);
24-
.init_array 0 : { *(SORT(.init_array.*)) *(.init_array) }
23+
.init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) }
2524

2625
__jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) }
2726
}

0 commit comments

Comments
 (0)