lkml.org 
[lkml]   [2016]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectAddress field in struct module_sect_attr
Date
I am debugging my kernel module during system boot.  In order to load symbols for my kernel module I tried to get the section name and address in GDB when my module was loaded. I set breakpoint at do_init_module. But when I dump the module_sect_attr I got the following.
 
(gdb) p mod
$31 = (struct module *) 0xffffffffa01ad100
 
(gdb) p mod->sect_attrs
$32 = (struct module_sect_attrs *) 0xffff8801305b2000
 
(gdb) p (struct module_sect_attrs *)mod->sect_attrs
$33 = (struct module_sect_attrs *) 0xffff8801305b2000
 
(gdb) p *(struct module_sect_attrs *)mod->sect_attrs
$34 = {grp = {name = 0xffffffff8186ff16 "sections", is_visible = 0x0 <irq_stack_union>, attrs = 0xffff8801305b2580, bin_attrs = 0x0 <irq_stack_union>}, nsections = 19,
  attrs = 0xffff8801305b2028}
 
(gdb) p (*(struct module_sect_attr *)0xffff8801305b2028)
$40 = {mattr = {attr = {name = 0xffff88003490d080 ".note.gnu.build-id", mode = 292}, show = 0xffffffff810e8a70 <module_sect_show>, store = 0x0 <irq_stack_union>,
    setup = 0x0 <irq_stack_union>, test = 0x0 <irq_stack_union>, free = 0x0 <irq_stack_union>}, name = 0xffff88003490d080 ".note.gnu.build-id", address = 18446744072100687872}
 
(gdb) p (*(struct module_sect_attr *)(0xffff8801305b2028+0x48))
$42 = {mattr = {attr = {name = 0xffff880034bd8a28 ".text", mode = 292}, show = 0xffffffff810e8a70 <module_sect_show>, store = 0x0 <irq_stack_union>, setup = 0x0 <irq_stack_union>,
test = 0x0 <irq_stack_union>, free = 0x0 <irq_stack_union>}, name = 0xffff880034bd8a28 ".text", address = 18446744072100675584}
 
At here why the section address is "18446744072100675584". Apparently this is not a valid address. How come this happens? And how I can get the correct section address so that I can load the symbol of my kernel module? Thanks.
 
My test system is CentOS 7. The kernel version is 3.10.0-327.el7.x86_64.
 
Michael
 

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.033 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site