linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Address field in struct module_sect_attr
       [not found] ` <CY1PR0501MB132474CB73E9E9BFAA408374B2E30@CY1PR0501MB1324.namprd05.prod.outlook.com>
@ 2016-08-31  9:00   ` Zhu, Michael J
  0 siblings, 0 replies; only message in thread
From: Zhu, Michael J @ 2016-08-31  9:00 UTC (permalink / raw)
  To: linux-kernel

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
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-31  9:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <FE840CE7327CA74183D7DE931E116F2408E2F8@wmsexchsvr02.winmagic.local>
     [not found] ` <CY1PR0501MB132474CB73E9E9BFAA408374B2E30@CY1PR0501MB1324.namprd05.prod.outlook.com>
2016-08-31  9:00   ` Address field in struct module_sect_attr Zhu, Michael J

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).