diff options
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index 6746c85511fe..49a405891587 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -3317,6 +3317,15 @@ static struct module *layout_and_allocate(struct load_info *info, int flags) | |||
3317 | ndx = find_sec(info, ".data..ro_after_init"); | 3317 | ndx = find_sec(info, ".data..ro_after_init"); |
3318 | if (ndx) | 3318 | if (ndx) |
3319 | info->sechdrs[ndx].sh_flags |= SHF_RO_AFTER_INIT; | 3319 | info->sechdrs[ndx].sh_flags |= SHF_RO_AFTER_INIT; |
3320 | /* | ||
3321 | * Mark the __jump_table section as ro_after_init as well: these data | ||
3322 | * structures are never modified, with the exception of entries that | ||
3323 | * refer to code in the __init section, which are annotated as such | ||
3324 | * at module load time. | ||
3325 | */ | ||
3326 | ndx = find_sec(info, "__jump_table"); | ||
3327 | if (ndx) | ||
3328 | info->sechdrs[ndx].sh_flags |= SHF_RO_AFTER_INIT; | ||
3320 | 3329 | ||
3321 | /* Determine total sizes, and put offsets in sh_entsize. For now | 3330 | /* Determine total sizes, and put offsets in sh_entsize. For now |
3322 | this is done generically; there doesn't appear to be any | 3331 | this is done generically; there doesn't appear to be any |