From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "identification" |
|---|
| subject | "Format:Linux kernel module (.ko)" |
|---|
| claim | "The generated <name>.mod.c defines struct module __this_module in section .gnu.linkonce.this_module with .name = KBUILD_MODNAME, .init = init_module only if the module has an init function, and .exit = cleanup_module only if it has a cleanup function and under CONFIG_MODULE_UNLOAD (so a module may carry neither); .arch = MODULE_ARCH_INIT follows. Relocations against this section reveal the entry points when present. The same file adds MODULE_INFO(name, ...) and intree=Y (non-external builds), staging=Y or test=Y by source path." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:Linux kernel module (.ko)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | method | "section" |
|---|
| indicator | ".gnu.linkonce.this_module" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "add_header emits __this_module with .name, conditional .init (mod->has_init) and .exit (mod->has_cleanup, CONFIG_MODULE_UNLOAD), .arch; MODULE_INFO(name), intree, staging, test" |
|---|
| repo | "https://github.com/torvalds/linux" |
|---|
| commit | "32c52ec87d6245ee2d12ed5dd509e40062939b50" |
|---|
| path | "scripts/mod/modpost.c" |
|---|
| lines | "1864-1892" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Module descriptor section" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T11:41:18.447Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T03:53:14.496Z" |
|---|
| result | "confirmed" |
|---|
| method | "Re-checked the correction at the cited commit: modpost.c add_header (1864-1892) emits .name always, .init only if mod->has_init, .exit only if mod->has_cleanup inside #ifdef CONFIG_MODULE_UNLOAD, then .arch, MODULE_INFO(intree) for non-external builds, staging for drivers/staging, test for tools/testing." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T02:50:45.585Z" |
|---|
| summary | "modpost add_header emits .init only if the module has an init function and .exit only if it has cleanup and CONFIG_MODULE_UNLOAD; the claim stated both unconditionally" |
|---|
| changed | | "claim" |
| "evidence replaced" |
|
|---|
|
|
|---|