There's nothing special to say here. This section contains only one structure--this_module, which is mostly filled with zeroes (as it is used by the LKM loader internally) except three fields:
- Name of the module
- A pointer to the initialization procedure--module_init
- A pointer to the de-initialization procedure--module_cleanup
These fields, in the case of this kernel version and this Linux distro, are located at offsets 0x18, 0x150, and 0x248, respectively; therefore, the code would be as follows:
section '.gnu.linkonce.this_module' writeable
this_module:
; Reserve 0x18 bytes
rb 0x18
; String representation of the name of the module
db 'simple_module',0
; Reserve bytes till the offset 0x150
rb 0x150 - ($ - this_module)
; The address of the module_init procedure
dq module_init
; Reserve bytes till the offset 0x248
rb 0x248 - ($ - this_module)
; The address of the module_cleanup procedure
dq module_cleanup
dq 0
This is all we had to take care of in this section.