From: "Zhu, Michael J" <michael.j.zhu@intel.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Address field in struct module_sect_attr
Date: Wed, 31 Aug 2016 09:00:16 +0000 [thread overview]
Message-ID: <AC7042C7324F7D45B01D2A153E151DC221E2B1A5@ORSMSX105.amr.corp.intel.com> (raw)
In-Reply-To: CY1PR0501MB132474CB73E9E9BFAA408374B2E30@CY1PR0501MB1324.namprd05.prod.outlook.com
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
parent reply other threads:[~2016-08-31 9:00 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <CY1PR0501MB132474CB73E9E9BFAA408374B2E30@CY1PR0501MB1324.namprd05.prod.outlook.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AC7042C7324F7D45B01D2A153E151DC221E2B1A5@ORSMSX105.amr.corp.intel.com \
--to=michael.j.zhu@intel.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).