Function report |
Source Code:kernel\module.c |
Create Date:2022-07-28 10:58:31 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Lay out the SHF_ALLOC sections in a way not dissimilar to how ldmight -- code, read-only data, read-write data, small data. Tallysizes, and place the offsets into sh_entsize fields: high bit means itbelongs in init.
Proto:static void layout_sections(struct module *mod, struct load_info *info)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
struct module * | mod | |
struct load_info * | info |
2422 | static unsigned long const masks[][2] = {{SHF_EXECINSTR | SHF_ALLOC, ARCH_SHF_SMALL}, {SHF_ALLOC, sh_flags | ARCH_SHF_SMALL}, {SHF_RO_AFTER_INIT | SHF_ALLOC, ARCH_SHF_SMALL}, {sh_flags | SHF_ALLOC, ARCH_SHF_SMALL}, {ARCH_SHF_SMALL | SHF_ALLOC, 0}} |
2434 | When i < e_shnum cycle sh_entsize = ~0UL |
2437 | pr_debug("Core section allocation order:\n") |
2441 | sname = secstrings + sh_name |
2443 | If (sh_flags & masks[m][0]) != masks[m][0] || sh_flags & masks[m][1] || sh_entsize != ~0UL || strstarts - does @str start with @prefix?*@str: string to examine*@prefix: prefix to look for. Then Continue |
2452 | Case m == 0 |
2453 | Total size. = debug_align( Total size. ) |
2455 | Break |
2456 | Case m == 1 |
2457 | Total size. = debug_align( Total size. ) |
2459 | Break |
2460 | Case m == 2 |
2461 | Total size. = debug_align( Total size. ) |
2463 | Break |
2464 | Case m == 4 |
2465 | Total size. = debug_align( Total size. ) |
2466 | Break |
2470 | pr_debug("Init section allocation order:\n") |
2474 | sname = secstrings + sh_name |
2476 | If (sh_flags & masks[m][0]) != masks[m][0] || sh_flags & masks[m][1] || sh_entsize != ~0UL || Not strstarts - does @str start with @prefix?*@str: string to examine*@prefix: prefix to look for. Then Continue |
2481 | sh_entsize = Update size with this section: return offset. | If this is set, the section belongs in the init part of the module |
2486 | Case m == 0 |
2487 | Total size. = debug_align( Total size. ) |
2489 | Break |
2490 | Case m == 1 |
2491 | Total size. = debug_align( Total size. ) |
2493 | Break |
2494 | Case m == 2 |
2500 | Break |
2501 | Case m == 4 |
2502 | Total size. = debug_align( Total size. ) |
2503 | Break |
Name | Describe |
---|---|
layout_and_allocate |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |