Skip to content

Instantly share code, notes, and snippets.

@haxpor
Created August 15, 2021 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haxpor/dd192e03104e67ef9f473c78ec8b2081 to your computer and use it in GitHub Desktop.
Save haxpor/dd192e03104e67ef9f473c78ec8b2081 to your computer and use it in GitHub Desktop.
Result from objdump of linux module which didn't use `module_init()/module_exit()`, and the one that use it.
haxpor@haxpor-desktop:.../Projects/kern_st/hello-1$ objdump -Tt hello-1.ko
hello-1.ko: file format elf64-x86-64
objdump: hello-1.ko: not a dynamic object
SYMBOL TABLE:
0000000000000000 l d .note.gnu.build-id 0000000000000000 .note.gnu.build-id
0000000000000000 l d .note.Linux 0000000000000000 .note.Linux
0000000000000000 l d .text 0000000000000000 .text
0000000000000000 l d .text.unlikely 0000000000000000 .text.unlikely
0000000000000000 l d .rodata.str1.1 0000000000000000 .rodata.str1.1
0000000000000000 l d __mcount_loc 0000000000000000 __mcount_loc
0000000000000000 l d .modinfo 0000000000000000 .modinfo
0000000000000000 l d .data 0000000000000000 .data
0000000000000000 l d .gnu.linkonce.this_module 0000000000000000 .gnu.linkonce.this_module
0000000000000000 l d .bss 0000000000000000 .bss
0000000000000000 l d .comment 0000000000000000 .comment
0000000000000000 l d .note.GNU-stack 0000000000000000 .note.GNU-stack
0000000000000000 l df *ABS* 0000000000000000 hello-1.mod.c
000000000000000c l O .modinfo 0000000000000023 __UNIQUE_ID_srcversion90
000000000000002f l O .modinfo 0000000000000009 __UNIQUE_ID_depends89
0000000000000038 l O .modinfo 000000000000000c __UNIQUE_ID_retpoline88
0000000000000044 l O .modinfo 000000000000000d __UNIQUE_ID_name87
0000000000000051 l O .modinfo 000000000000002f __UNIQUE_ID_vermagic86
0000000000000000 l O .note.Linux 0000000000000018 _note_7
0000000000000000 l df *ABS* 0000000000000000 hello-1.c
0000000000000000 l O .modinfo 000000000000000c __UNIQUE_ID_license86
0000000000000000 g O .gnu.linkonce.this_module 0000000000000380 __this_module
0000000000000019 g F .text.unlikely 0000000000000017 cleanup_module
0000000000000000 *UND* 0000000000000000 __fentry__
0000000000000000 g F .text.unlikely 0000000000000019 init_module
0000000000000000 *UND* 0000000000000000 printk
DYNAMIC SYMBOL TABLE:
no symbols
haxpor@haxpor-desktop:.../Projects/kern_st/hello-1$ objdump -Tt hello-2.ko
hello-2.ko: file format elf64-x86-64
objdump: hello-2.ko: not a dynamic object
SYMBOL TABLE:
0000000000000000 l d .note.gnu.build-id 0000000000000000 .note.gnu.build-id
0000000000000000 l d .note.Linux 0000000000000000 .note.Linux
0000000000000000 l d .text 0000000000000000 .text
0000000000000000 l d .init.text 0000000000000000 .init.text
0000000000000000 l d .exit.text 0000000000000000 .exit.text
0000000000000000 l d .rodata.str1.1 0000000000000000 .rodata.str1.1
0000000000000000 l d __mcount_loc 0000000000000000 __mcount_loc
0000000000000000 l d .modinfo 0000000000000000 .modinfo
0000000000000000 l d .data 0000000000000000 .data
0000000000000000 l d .gnu.linkonce.this_module 0000000000000000 .gnu.linkonce.this_module
0000000000000000 l d .bss 0000000000000000 .bss
0000000000000000 l d .comment 0000000000000000 .comment
0000000000000000 l d .note.GNU-stack 0000000000000000 .note.GNU-stack
0000000000000000 l df *ABS* 0000000000000000 hello-2.mod.c
000000000000000c l O .modinfo 0000000000000023 __UNIQUE_ID_srcversion90
000000000000002f l O .modinfo 0000000000000009 __UNIQUE_ID_depends89
0000000000000038 l O .modinfo 000000000000000c __UNIQUE_ID_retpoline88
0000000000000044 l O .modinfo 000000000000000d __UNIQUE_ID_name87
0000000000000051 l O .modinfo 000000000000002f __UNIQUE_ID_vermagic86
0000000000000000 l O .note.Linux 0000000000000018 _note_7
0000000000000000 l df *ABS* 0000000000000000 hello-2.c
0000000000000000 l F .init.text 0000000000000019 hello_2_init
0000000000000000 l F .exit.text 0000000000000012 hello_2_exit
0000000000000000 l O .modinfo 000000000000000c __UNIQUE_ID_license86
0000000000000000 g O .gnu.linkonce.this_module 0000000000000380 __this_module
0000000000000000 g F .exit.text 0000000000000012 cleanup_module
0000000000000000 *UND* 0000000000000000 __fentry__
0000000000000000 g F .init.text 0000000000000019 init_module
0000000000000000 *UND* 0000000000000000 printk
DYNAMIC SYMBOL TABLE:
no symbols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment